12-10-2015 02:35 PM
Hi guys,
I've got some pumps I'm controlling with LabVIEW, and I've run into this mysterious error quite a few times. The pumps are issued a command every 5-10 minutes, and the connection is closed. The reason is that these pumps may run for several days at a time, and I've issues in the past with connection stagnating, causing a loss of communication. Even though I don't do a VISA Open when send the command, the pumps still respond.
Reading into the unkown system error, it seems like it stems from misconfigured serial port settings. I have a VI to configure those, as well as do a VISA open, but I was wondering if it was necessary. Should it go (initialize connection, send command, close connection) or could this error be coming from somewhere else.
The only reason I haven't just tested it is that the error is extremely rare (once or twice in every 20 on-hours), and I find it hard to duplicate it.
12-10-2015 02:55 PM - edited 12-10-2015 02:56 PM
Without posting your code we can only guess.
So my best guess is cosmic rays disrupting the serial connection.
12-10-2015 02:59 PM - edited 12-10-2015 03:01 PM
This is with the "Initialize" added before every command. Before there was no Initialize.
The initialize just does a VISA Open, sets properties using a property node, and gets the attention of the pump.
12-10-2015 03:02 PM
12-10-2015 03:04 PM
Are you using USB-RS323 adapters? If so, there is a setting for the USB hubs that Windows will randomly turn off power to the hub. This is a "power saving feature". Go into the device manager and make sure that is turned off.
12-10-2015 03:06 PM - edited 12-10-2015 03:07 PM
@crossrulz wrote:
Are you using USB-RS323 adapters? If so, there is a setting for the USB hubs that Windows will randomly turn off power to the hub. This is a "power saving feature". Go into the device manager and make sure that is turned off.
Good call crossrulz, that reminds me of a problem I had with USB to Serial adaptors that randomly stopped responding.
Turned out they had counterfeit "Prolific" chips in them and the new Prolific drivers was causing them to stop responding.
12-10-2015 03:13 PM
Just USB, crossrulz. The pumps are hooked up to an Amazon Basics USB Hub, though they have their own power supply. The hub connects to a USB 2.0 on my computer. I also have some microcontrollers that get power from the hub, and they have never indicated a loss of power. I'll check the device manager though.
I've attached the relevant VI's to this message.
The ones you want to open up are "run pumps.vi" and "pause pumps.vi" in the Users\Leon\Desktop\...\Singular Function VIs\ folder. Sorry for the spaghetti code in advance.
12-10-2015 03:19 PM
12-10-2015 03:23 PM
True. This is code I wrote when I was still very new LabVIEW, and haven't really touched since. Good pickup. Where in Device Manager can I disable that power saving feature?
12-10-2015 03:38 PM - edited 12-10-2015 03:45 PM
That is not in Device Manager, but under Power Options in Windows7 in Control Panel. Select Change plan settings for the Active power plan and then select Change advanced power settings. In the pop-up windows, find USB settings.
What can happen is that Windows can/will turn off the PC's USB ports, so that is can "save" power.
When this happens you can get communication to any USB devices connected, even if they are connected to a USB hub with external power. The PC's USB ports are closed down.