10-21-2013 09:49 AM
Hello to all,
I'm having a problem with my first Arduino project and it's strange that I don't see anyone talking about this issue in this forum.
I'm using my Arduino to control a system that checks if a Light array is working properly. To do that, it uses the digital output to control a relay, that turns on the lamp in test. And then uses the analogue input channel to measure the current consumed by the lamp (using a shunt resistor, etc).
Everything works well in 6 of the seven machines (all with the same hardware). But for some reason, one of those looses communication with the Arduino. And then I try to:
1. restart visa communications inside the application;
2. restart the application;
But with no success.
The solution for this is to remove the serial port in device manager (windows 7 32 bits) and rescan again. After this procedure my application can again work well again.
This is happening 5 times a day with no logical explanation.
I think that the problem is related to the usb communication (maybe noise). And I accept that. But how can I workaround this without removing the serial port mannually?
Thanks to all
10-21-2013 08:25 PM
I would think you would be able to check for that error and when it happens, use Close.vi to release the serial port and then run Init.vi to reconnect to the Arduino.
Let me know if this works for you.
10-22-2013 04:13 PM
Hello Nathan,
I'm doing that already.
I can't remember very well the last time that I saw this happening but I think that even disconnecting the usb cable and reconnecting again didn't solved. The only solution is uninstall the serial port in device manager (or restart computer).
10-22-2013 04:37 PM
If removing the serial port and restarting the computer are the only methods for 'fixing' the issue it implies that it is not an issue with LabVIEW but rather the OS and/or hardware.
10-24-2013 08:26 AM
It sounds very much like a problem I had a couple of years ago. I would loose communications with one (or more) of my USB -> Serial Comm ports. If I looked in MAX or device manager afterwards I would see that new comm ports had be "created" by Windows, i.e. com3, com4 would be com12, com13. I tried isolating the usb by putting a powered usb hub, using the special noise reducing usb cables (they have a ferrite core in them), etc. to no avail. An NI engineer called me, having seen my posts on the LabVIEW forums, said that they had seen problems with that particular PC vendors motherboards (HP compact desktop machine from about 4 years ago), recommended putting a dedicated USB board in. After doing that the problem went away. So, bottom line, any "glitching" on the USB bus can cause Windows to reassign that physical USB port to a new number, which closing the VISA connection and doing an init won't fix.
Good Luck
10-24-2013 09:26 AM
In that case, closing the connection and then searching for the board again should work (assuming the board is correctly identifying itself to the OS which hasn't been the case for me recently).
10-24-2013 12:43 PM
No, the problem is with Windows. You won't be able to close the connection, the reference is no longer pointing to a valid comm port, as far as Windows is concerned, assuming this a similar problem. Look at the comm ports in MAX before and after the "incident", see it the port you originally were talking to is still listed, and if not, what new port has shown up. This may not be the same as I experienced, but is sort of sounds similar.
Look here http://forums.ni.com/t5/LabVIEW/MAX-launches-multiple-instances/td-p/990235 and see if helps.
10-25-2013 06:17 AM
Hello and thanks guys for your support.
The machine where the problem happens in not near me and because of that it's not easy to see some situations.
But I can say that the serial port names are always the same. But I liked the explanation of the motherboard.
I think that out approach is going to be by a new USB PCI board.
Thanks for your help and best regards