# Setting up labjack

**URL:** <https://mworks.discourse.group/t/setting-up-labjack/829>\
**Category:** Support\
**Created:** [September 20, 2022, 4:10pm UTC](https://mworks.discourse.group/t/setting-up-labjack/829 "2022-09-20T16:10:00Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![hansem](https://avatars.discourse-cdn.com/v4/letter/h/7bcc69/32.png) [@hansem](https://mworks.discourse.group/u/hansem)\
**Post date:** [September 20, 2022, 4:10pm UTC](https://mworks.discourse.group/t/setting-up-labjack/829/1 "2022-09-20T16:10:01Z")

</div>

Hi Chris,

I’m setting up labjack as an alternative to NIDAQ and got the following error when loading the experiment (after upgrading mworks into Version 0.12.dev (2022.09.20)):

**00:02:38** : ERROR: Failed to create object.  
Extended information:  
reason: No factory for object type: iodevice/labjack\_ljm  
location: labjack.mwel: line 1, column 1  
object\_type: iodevice/labjack\_ljm  
ref\_id: idm35182208572048  
component: labjack  
parser\_context: mw\_create

I see LabJackLJM.bundle in /Library/Application Support/MWorks/Plugins/Core.

I’m using model T7 and installed the LabJack LJM library. T7 is working fine as I did the labjack’s quick start tutorial. Is there any other procedure I need to complete?

Here’s piece of code I’m using:

iodevice/labjack\_ljm labjack (  
update\_interval = 1ms // 3ms  
device\_type = T7  
connection\_type = USB // ETHERNET  
// identifier = LJM\_idANY // 192.168.1.207 // example  
autostart = true // NO  
) {  
iochannel/labjack\_ljm\_digital\_output(  
line = FIO0 // example  
value = reward\_line  
)  
iochannel/labjack\_ljm\_digital\_output( // target on  
line = FIO2  
value = labjack\_target\_on  
)  
iochannel/labjack\_ljm\_digital\_output( // cue on  
line = FIO3  
value = labjack\_cue\_on  
)  
}  
start\_io\_device (labjack)

Thanks,  
Hansem

---

<div class="post-metadata">

**Author:** ![cstawarz](https://yyz1.discourse-cdn.com/flex031/user_avatar/mworks.discourse.group/cstawarz/32/3_2.png) [@cstawarz](https://mworks.discourse.group/u/cstawarz)\
**Post date:** [September 20, 2022, 7:07pm UTC](https://mworks.discourse.group/t/setting-up-labjack/829/2 "2022-09-20T19:07:18Z")

</div>

Hi Hansem,

Are you running MWorks on an Apple Silicon (M1/M2) Mac? If so, you need to configure MWServer to run as an Intel process via [Rosetta 2](https://support.apple.com/en-us/HT211861), as the [LabJack LJM library](https://labjack.com/support/software/installers/ljm) is currently available only for the Intel architecture.

If you’re _not_ using an Apple Silicon Mac, please let me know, and we’ll investigate other possible causes of this problem.

Cheers,  
Chris

---

<div class="post-metadata">

**Author:** ![hansem](https://avatars.discourse-cdn.com/v4/letter/h/7bcc69/32.png) [@hansem](https://mworks.discourse.group/u/hansem)\
**Post date:** [September 20, 2022, 7:31pm UTC](https://mworks.discourse.group/t/setting-up-labjack/829/3 "2022-09-20T19:31:14Z")

</div>

Thanks for your quick reply, Chris!  
I’m not using Apple Silicon (M1/M2) mac. Let me know if you have any other idea.

Thanks,  
Hansem

---

<div class="post-metadata">

**Author:** ![cstawarz](https://yyz1.discourse-cdn.com/flex031/user_avatar/mworks.discourse.group/cstawarz/32/3_2.png) [@cstawarz](https://mworks.discourse.group/u/cstawarz)\
**Post date:** [September 21, 2022, 1:53pm UTC](https://mworks.discourse.group/t/setting-up-labjack/829/4 "2022-09-21T13:53:13Z")

</div>

Hi Hansem,

OK, let’s first check if the LabJack LJM plugin is being loaded and if not, why. To do this, first quit MWServer if it’s running. Then, open the Terminal application, and execute the following command:

```
MWORKS_WRITE_MESSAGES_TO_STDERR=1 /Applications/MWServer.app/Contents/MacOS/MWServer

```

This should produce a bunch of messages about plugins being loaded. For example, on my M1 iMac, here’s what I see:

```auto
Loading WhiteNoiseBackground
Loading TouchInput
Loading ZenSchedulerPlugin
Loading Eyelink
WARNING: Plugin module (Eyelink) failed to load: dlopen(/Library/Application Support/MWorks/Plugins/Core/Eyelink.bundle/Contents/MacOS/Eyelink, 0x0001): tried: '/Library/Application Support/MWorks/Plugins/Core/Eyelink.bundle/Contents/MacOS/Eyelink' (mach-o file, but is an incompatible architecture (have (x86_64), need (arm64e)))
Loading FaceRecognizer
Loading ZenStateSystemPlugin
Loading ParametricShape
Loading ISCAN
Loading Firmata
Loading DATAPixx
WARNING: Plugin module (DATAPixx) failed to load: dlopen(/Library/Application Support/MWorks/Plugins/Core/DATAPixx.bundle/Contents/MacOS/DATAPixx, 0x0001): tried: '/Library/Application Support/MWorks/Plugins/Core/DATAPixx.bundle/Contents/MacOS/DATAPixx' (mach-o file, but is an incompatible architecture (have (x86_64), need (arm64e)))
Loading BlackrockLEDDriver
Loading LabJackLJM
WARNING: Plugin module (LabJackLJM) failed to load: dlopen(/Library/Application Support/MWorks/Plugins/Core/LabJackLJM.bundle/Contents/MacOS/LabJackLJM, 0x0001): tried: '/Library/Application Support/MWorks/Plugins/Core/LabJackLJM.bundle/Contents/MacOS/LabJackLJM' (mach-o file, but is an incompatible architecture (have (x86_64), need (arm64e)))
Loading HighPrecisionClock
Loading XIMEACamera
Loading FakeMonkeyPlugin
Loading TextStimulus
Loading PythonPlugin
Loading OpenEphys
Loading NE500Plugin
Loading LayerStimulus
Loading DriftingGratingStimulusPlugin
Loading ServersideConduit
Loading RCBLVDS
Loading MovieStimulusPlugin
Loading MouseInput
Loading QCUALOR
Loading EasyEye
Loading LowPrioritySchedulerPlugin
Loading VideoStimulus
Loading MovingDots
Loading USBHID
Loading RenderActions
Creating realtime components:
  clock:	MachClock
  scheduler:	ZenScheduler
  state_system:	ZenStateSystem

```

Please copy the messages you see on your system and send them to me.

Thanks,  
Chris

---

<div class="post-metadata">

**Author:** ![hansem](https://avatars.discourse-cdn.com/v4/letter/h/7bcc69/32.png) [@hansem](https://mworks.discourse.group/u/hansem)\
**Post date:** [September 21, 2022, 3:02pm UTC](https://mworks.discourse.group/t/setting-up-labjack/829/5 "2022-09-21T15:02:10Z")

</div>

Great, the message (see below) already gives me the reason! I’ve installed the releases version of LJM library (2019/2/14) which uses LJM Library - Version: 1.20. But I need 1.21 so I installed beta version and now it’s working.  
Thanks for your help!  
Hansem

======  
Loading WhiteNoiseBackground

Loading TouchInput

Loading ZenSchedulerPlugin

Loading Eyelink

Loading FaceRecognizer

Loading ZenStateSystemPlugin

Loading ParametricShape

Loading ISCAN

Loading Firmata

Loading DATAPixx

Loading BlackrockLEDDriver

Loading LabJackLJM

WARNING: Plugin module (LabJackLJM) failed to load: dlopen(/Library/Application Support/MWorks/Plugins/Core/LabJackLJM.bundle/Contents/MacOS/LabJackLJM, 1): Library not loaded: /usr/local/lib/libLabJackM.dylib

Referenced from: /Library/Application Support/MWorks/Plugins/Core/LabJackLJM.bundle/Contents/MacOS/LabJackLJM

Reason: Incompatible library version: LabJackLJM requires version 1.21.0 or later, but libLabJackM.dylib provides version 1.20.0

Loading HighPrecisionClock

Loading XIMEACamera

WARNING: Plugin module (XIMEACamera) failed to load: dlopen(/Library/Application Support/MWorks/Plugins/Core/XIMEACamera.bundle/Contents/MacOS/XIMEACamera, 1): Library not loaded: /Library/Frameworks/m3api.framework/Versions/B/m3api

Referenced from: /Library/Application Support/MWorks/Plugins/Core/XIMEACamera.bundle/Contents/MacOS/XIMEACamera

Reason: image not found

Loading FakeMonkeyPlugin

Loading TextStimulus

Loading PythonPlugin

Loading OpenEphys

Loading NE500Plugin

Loading LayerStimulus

Loading DriftingGratingStimulusPlugin

Loading ServersideConduit

Loading RCBLVDS

Loading MovieStimulusPlugin

Loading MouseInput

Loading QCUALOR

Loading EasyEye

Loading LowPrioritySchedulerPlugin

Loading VideoStimulus

Loading MovingDots

Loading USBHID

Loading RenderActions

Creating realtime components:

clock: HighPrecisionClock

scheduler: ZenScheduler

state\_system: ZenStateSystem

---

<div class="post-metadata">

**Author:** ![cstawarz](https://yyz1.discourse-cdn.com/flex031/user_avatar/mworks.discourse.group/cstawarz/32/3_2.png) [@cstawarz](https://mworks.discourse.group/u/cstawarz)\
**Post date:** [September 22, 2022, 2:28pm UTC](https://mworks.discourse.group/t/setting-up-labjack/829/6 "2022-09-22T14:28:57Z")

</div>


