Jump to content

As of July 17, 2015, the LabJack forums here at forums.labjack.com are shut down. New registrations, topics, and replies are disabled. All forums are in a read-only state for archive purposes.

Please visit our current forums at labjack.com/forums to view and make new posts. To post on the current forums, use your labjack.com login account. Your old LabJack forums login credentials have been retired. There are no longer separate logins for labjack.com and LabJack forums.


Photo

communication error 1008


  • Please log in to reply
10 replies to this topic

#1 statcomp

statcomp
  • Members
  • 9 posts

Posted 17 July 2012 - 07:03 AM

We are using LabJack U3 (USB) to control intensity of multiple lights within MATLAB. The program basically uses U3_Simple_Digital.m to do what we need. And it's working great most of time. But one problem is that when the program communicates with serial port connected to another device, U3 completely loses communication with USB and the program gives communication failure error (1008) so we have to manually unplug/replug USB from/to PC - restarting program does not work. We will look into more on the problem between devices. But I would like to know if there is any way to reset USB connection without manually replugging USB to PC. Thanks

#2 LabJack Support

LabJack Support
  • Admin
  • 8677 posts

Posted 17 July 2012 - 08:20 AM

We have an app note about communication problems:

http://labjack.com/s...cation-failures

... but yours seems different. Is your RS232 port from a USB to RS232 converter?

If you make the serial calls with nothing connected to the serial port, does that still cause the problem?

#3 statcomp

statcomp
  • Members
  • 9 posts

Posted 17 July 2012 - 10:42 AM

We have an app note about communication problems:

http://labjack.com/s...cation-failures

... but yours seems different. Is your RS232 port from a USB to RS232 converter?

If you make the serial calls with nothing connected to the serial port, does that still cause the problem?


No I think problem is our COM device. The other COM device is a pressuring system. For some reason, whenever it emits gas, the labjack loses USB connection. Interesting thing is that after losing USB connection, the first statement in following code runs OK but the second statement with LJ_ioPIN_CONFIGURATION_RESET produces "Communication failure". I just want to recover from the disconnection more nicely. Is there any way to refresh current USB connection with code?

[Error ljHandle] = ljud_OpenLabJack(LJ_dtU3,LJ_ctUSB,'1',1);
Error_Message(Error)

Error = ljud_ePut(ljHandle, LJ_ioPIN_CONFIGURATION_RESET, 0, 0, 0);
Error_Message(Error)

#4 LabJack Support

LabJack Support
  • Admin
  • 8677 posts

Posted 17 July 2012 - 11:35 AM

I don't think there is a way to instruct the host to cycle the port, but will have someone else comment on that. So the problem does not happen if you talk to the RS232 port with nothing connected. Sounds like it is not a driver conflict, but rather the RS232 device does something or causes some transient that knocks out the USB port the U3 is using. In that case, the info on the app note I sent does seem useful. Start by seeing if you still have the problem with nothing connected to the U3 except for USB.

#5 statcomp

statcomp
  • Members
  • 9 posts

Posted 17 July 2012 - 01:33 PM

Actually, I've followed all app note suggested in vain. I understand my COM device would make something disconnected but wonder why only Labjack U3 is disconnected. Other USB devices such as mouse and keyboard are just fine after the gas emission. I just can't make a program with which user should manually replug USB. If there is no way to refresh its USB connection, is there any method to release the labjack handle that was initialized?

#6 LabJack Support

LabJack Support
  • Admin
  • 8677 posts

Posted 17 July 2012 - 03:02 PM

So even with nothing connected except USB, you see: - Sending RS232 commands without gas device connected causes no problem with U3. - Sending RS232 commands with gas device connected causes USB problems on the U3 port.

#7 LabJack Support

LabJack Support
  • Admin
  • 8677 posts

Posted 17 July 2012 - 03:09 PM

There currently isn't an easy way to reset the USB port in that way. The closest option might be to consider using the watchdog timer. It's strange for it to die like that. Have you tried using a powered hub?

#8 statcomp

statcomp
  • Members
  • 9 posts

Posted 17 July 2012 - 05:09 PM

So even with nothing connected except USB, you see:

- Sending RS232 commands without gas device connected causes no problem with U3.
- Sending RS232 commands with gas device connected causes USB problems on the U3 port.


Yup. That's exactly what's happening.

#9 statcomp

statcomp
  • Members
  • 9 posts

Posted 17 July 2012 - 05:15 PM

There currently isn't an easy way to reset the USB port in that way. The closest option might be to consider using the watchdog timer.

It's strange for it to die like that. Have you tried using a powered hub?


I appreciate your patient answers so far.

I really hoped that there is a way first to remember USB port connected to LabJack device and then to refresh the connection when the disconnection happens.

My options are currently bottomed out. Can you tell me how I can get and use the watchdog timer? Thanks

#10 LabJack Support

LabJack Support
  • Admin
  • 8677 posts

Posted 18 July 2012 - 09:43 AM

So the gas device does something that causes the USB port to "forget" the U3 is there.

There is no way to tell Windows to reset the port and notice that the U3 is still fine.

Usually this happens because a transient comes in on some I/O connection or GND or VS, and travels through the U3 to the USB port. The U3 can handle it, but the USB port cannot. You are seeing it happen with no connections/wires except for USB, though, so that is strange. What if you physically move the U3 and USB cable away from the gas device and perhaps connect to a different USB port? What if you try a hub or a different hub (all hubs should have their own power-supply, not get power from the USB cable)?

Perhaps try the $38 isolator mentioned near the end of this page:

http://labjack.com/s...s/usb-via-other

The U3 itself can notice that there is no communication, and reset itself, and that might cause the USB port to notice that it is there. Use the watchdog for that. You can enable the watchdog using the "config defaults" section in LJControlPanel, but it is better to add code to your program to enable it at the beginning and disable it on exit:

http://labjack.com/s...rs-guide/4.3.13

#11 statcomp

statcomp
  • Members
  • 9 posts

Posted 18 July 2012 - 01:51 PM

There currently isn't an easy way to reset the USB port in that way. The closest option might be to consider using the watchdog timer.

It's strange for it to die like that. Have you tried using a powered hub?


Good news. We tried a powered hub and it worked like a charm. Thanks a lot for your help to give us the solution.


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users