Setting up labjack

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

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, as the LabJack LJM library 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

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

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:

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

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