Labjack U3 - Matlab error | LabJack
 

Labjack U3 - Matlab error

7 posts / 0 new
Last post
Lalit
29.lalit's picture
Labjack U3 - Matlab error

Hey Guys,

I have an U3 that i am communicating with using matlab. I have been using it for sometime and there has been no problems with it. But for the past couple of days, every now and then I get the following error:

Error using OddNumberTask (line 19)
Message: Error in the application.
Source: LJUDDotNet
HelpLink

the code on line 19 is :[ljerror, ljhandle] = ljudObj.OpenLabJack(LabJack.LabJackUD.DEVICE.U3, LabJack.LabJackUD.CONNECTION.USB, '0', true, 0);

I ran it again using the show error message.m file and I got the following error:

OddNumberTask
UD Error: Communications failure                                                                                                                                                                                                                                        
Error using OddNumberTask (line 20)
Message: Error in the application.
Source: LJUDDotNet
HelpLink:

I need to restart matlab and dissconnect and reconnect labjack and only them I am able to communicate with it again and even after that I get the same error message after working fine for like 2-3times.

I need help.

Thank you

LabJack Support
labjack support's picture
If you disconnect all

If you disconnect all connections to your U3, do the communication failures still occur? If the communication failures stop, a signal to the U3 is likely causing it to reset (LED will blink a couple of times) or causing USB issues. In that case, what is connected to your U3?

If the communication failures don't stop when you disconnect all connections, try connecting your U3 to a different USB port on your computer and try a different USB cable and see if that helps.

For more troubleshooting, take a look at the USB Communication Failure page.

Lalit
29.lalit's picture
I just disconnected all

I just disconnected all connections to the U3 and ran the matlab program and after few successful tries still the communications failure occurs. I checked to see if the the LED blinks anytime during the program but i don't see anything. Its constantly lit, the only time it blinks, is when I remove and plug in the USB cable.

I also tried changing the USB cable and plugging into a different USB port, but still the communication failure occurs after few successful attempts.

LabJack Support
labjack support's picture
If you try LJLogUD or

If you try LJLogUD or LJControlPanel (and its test panel), do you see communication failures there? I'm wondering if you are seeing this with your MATLAB code only or in general on your system. If possible, other tests to try is to connect your U3 to a USB hub and then to your computer and see if that helps, or if you are seeing the problem on a different computer.

You mentioned this has just recently started. Did you recently change the connections/signals to your U3, install new Windows software and connect something new to your computer?

Can you provide your MATLAB code that causes the issue? Either an attachment (best way on the forum) or send it to [email protected] if you don't want it to be public.

If possible

LabJack Support
labjack support's picture
A couple more ideas:

A couple more ideas:

  • Reset the device's configuration. Remove all connections to the U3 and connect a jumper between FIO6 and SPC. Then power cycle the U3 and remove that jumper. That will clear features such as the watchdog.
  • File corruption is another possibility. If the above jumper does not help uninstall and reinstall the UD driver and update the U3's firmware.

I think that covers all the bases. If you still have issues after that, then we will need to look at your code and consider a the possibility of a hardware failure.

Lalit
29.lalit's picture
Hi, 

Hi, 

So i was able to figure out the problem finally. While my matlab program is running, I am running another application which utilizes my USB webcam for video processing simultaneously for facial detection.

So the communications failure occurs when my other application is using the camera for facial detection. Any thoughts on as to why this is happening?

LabJack Support
labjack support's picture
I'm not exactly sure what is

I'm not exactly sure what is happening, but your other application or camera may be causing issues with the Windows USB layer or the USB host leading to Windows and the USB host having communication issues with the U3.

How much memory is your other application using? I seen an issue where an application had a memory leak, used all the system memory and caused communication/connection issues with a LabJack. I'm curious if your system memory usage is getting maxed out by your other application and causing the communication failures with the U3. You can keep track of your system's memory usage with the Windows Task Manager.

Try connecting your camera to another USB port and see if that helps, or if you have a USB hub try connecting it through that to your computer. Also, you could try setting a higher priority to MATLAB (which is running your LabJack code) and see if that helps. After starting MATLAB, using the Windows Task Manager, you can right mouse click the process and "Set Priority".