Labjack, error defining the driver

Hi Chris,
Here Jaime from schmidlab in fribourg
I’m starting to transition from using NI-DAQ to LabJack T4. I installed the required drivers for a T4 on a MacBook Pro (M1) with Sonoma (14.6.1). I’m using MWorks 13.
By using the following definition (labjack):

var test_input=0
iodevice/labjack_ljm labjack (
update_interval = 1ms
connection_type = USB
device_type = T4
autostart = true
){
iochannel/labjack_ljm_analog_input(
line = AIN0
value = test_input
)
}

Im having the following error

01:38:11: ERROR: An unanticipated error occurred. This is probably a bug, and someone will want to run this in a debugger. Error message was: “vector”
01:38:11: ERROR: Cannot turn off LabJack LJM device COMM LED; error = 1307 (LJME_OLD_FIRMWARE)
01:38:11: ERROR: Failed to parse experiment /var/folders/h3/mvv2pvgs1ml3dlbxj_tgvqj80flgc_/T/MWorks/Experiment Cache/_Users_cadenava_Documents_GitHub_SRG_repo_Projects_Test_scripts_Test_labjack.mwel/tmp/_Users_cadenava_Documents_GitHub_SRG_repo_Projects_Test_scripts_Test_labjack.mwel.xml

any suggestions??
Thanks a lot for the help

Jaime

Hi Jaime,

It looks like there may be an error in MWorks’ handling of a LabJack error, which leads to the “unanticipated error occurred” message, so I’ll need to look in to that. However, the LJME_OLD_FIRMWARE error code suggests that the root problem may be that your T4’s firmware is indeed too old. (I’ve seen brand-new devices ship with very-old firmware before, so this wouldn’t surprise me.)

Can you try updating your T4 to the latest firmware and see if that resolves the issue? You’ll need to use the Device Updater tab in the Kipling application.

Cheers,
Chris

FYI, I’ve identified the issue with MWorks’ error-handling code. I will try to get a fix in to the nightly build soon.

Chris

Hi Chris,

I updated the firmware and now the test program is running
However I got the following error every 2 to 3 seconds:
"
WARNING: Scheduled task (/Users/cstawarz/mworks-buildbot/worker/build_for_macos/build/plugins/core/LabJackLJM/LabJackLJM/LabJackLJMDevice.cpp:656) falling behind, dropping 3 scheduled executions (priority = 2, interval = 1000, task = 0x600002d6a8a0)
"

Is this something that can compromises timing?

Cheers,

Jaime

Hi Jaime,

Those warnings indicate that MWorks can’t read inputs from the LabJack device as often as you’ve asked. Try increasing the value of the update_interval parameter. You could try 2ms to start, but you may find that you need to increase it further (maybe up to 5ms).

Cheers,
Chris

Perfect, that worked well.
Thank you very much!!!