Open multiple LabJack T7s troobleshooting | LabJack
 

Open multiple LabJack T7s troobleshooting

11 posts / 0 new
Last post
francoisbiar
francoisbiar's picture
Open multiple LabJack T7s troobleshooting

Hello,

I have two labjack T7 (one regular, and one Pro) I would like to use for an experiment, and I have trouble opening it in my python program, depending on which order I do things. I use their serial numbers to identify them. The T7 serial is 470012991, and the T7-PRO's 470012790.I Use Python_LJM 12/03/2015 and the 2016_11_09_x86_64 ljm software on Ubuntu 16.04.Here's the code I execute :

from labjack import ljm

handle1 = ljm.openS("ANY", "ANY", '470012790')
print ljm.eReadName(handle1, "SERIAL_NUMBER")
handle2 = ljm.openS("ANY", "ANY", '470012991')
print ljm.eReadName(handle2, "SERIAL_NUMBER")

This simple script permits to reproduce the issue. Regardless of the order in which I connect them (USB), I get an error when trying to open the second one, although I'm sure handle1 is properly opened. ljm.open cannot find the second labjack, and if I reverse the order of opening (I start with handle2), I am able to open both labjacks correctly, so this is a workaround for me.Is this a bug, or have you noticed this strange behavior by the past?

LabJack Support
LabJack Support's picture
Does it work better if you

Does it work better if you pass devicetype="t7" and connectiontype="usb"?

francoisbiar
francoisbiar's picture
I just tried, i doesn't

I just tried, i doesn't change anything.

LabJack Support
LabJack Support's picture
I've replicated the issue and

I've replicated the issue and I'll keep this thread updated.

LabJack Support
LabJack Support's picture
I've fixed the issue in the

I've fixed the issue in the version of LJM after 1.1404 and I will update this thread when the fix is released.

LabJack Support
LabJack Support's picture
The fix is in LJM 1.1405, now

The fix is in LJM 1.1405, now available here:

https://labjack.com/support/software/installers/ljm

vogelsanger
vogelsanger's picture
Hello,

Hello,

I have a similar issue. I connected two T7-Pro via USB with my PC (Windows 10) and the Python_LJM_2018_10_19 library.

If i start the connection in one python console it works fine, if i start the second program in a separate console, i get this error message:

LJMError: LJM library error code 1230 LJME_DEVICE_CURRENTLY_CLAIMED_BY_ANOTHER_PROCESS: process 'pythonw.exe' (pid 3732) has claimed USB connection to LJM_dtT7 with serial# 470016765 named My_T7_6765

My connection commands are:     handle = ljm.openS("T7","USB","470018437")

                                                      handle = ljm.openS("T7","USB","470016765")

It doesn't help to change the order of connection or switch the USB plug.

 

Should i try anything else?

LabJack Support
LabJack Support's picture
The T7 can only talk to one

The T7 can only talk to one software process at a time. The 1230 error you mention is saying that essentially pythonw.exe has claimed that one USB connection. If you shut down pythonw.exe and all other processes that are talking to the T7, does the connection happen successfully?

vogelsanger
vogelsanger's picture
Thank you for your prompt

Thank you for your prompt reply.

Yes the two T7's should each communicate with their own program. Neither both T7 in one program or two programs for one T7.

I wrote two programs which should each only interact with one T7. The processes should work parallel controlled by one pc in two separeted consoles.

But if one program in the one console interacting with the T7 (SN:  470018437) was succesfully started, the other program in the seperate console interacting  with the T7 (SN: 470016765) will not start till i shut down the first console process.

Is there no way to let the two processes work parallel with each one seperate T7 for their own with only one pc?

Or do i have to write one program which interact with both T7?

Thank you so far!

LabJack Support
LabJack Support's picture
Hello,

Hello,

We were likely able to reproduce your issue and can continue to look into it this. 

While waiting for a possible driver fix, one option is for you to add some re-try logic around your device opening code and try a second time. Will this work for you?

vogelsanger
vogelsanger's picture
Hey,

Hey,

while i was trying to build in the retry logic, i found a copy paste fault, where i double used the Serialnumber of one T7 in both programs.

Thats the reason why it wouldn't start, now everything works fine! Sorry and thank you for your fast support.

Greetings and go on like this!