05-30-2014 03:27 PM
Hi, my LabView application is to set a power supply, enable output, and monitor volt and current using VISA based drivers download from NI. I would like to know if there is a way to recover VISA connection loss when it happens (e.g. cable problem, etc.) while VI is still running. I hope something can be done in LabView so that if that happens, I can reconnect cable and the application reestablish VISA connection and continuously monitoring the PS outputs without restart the application. Thanks in advance!
05-31-2014 09:48 AM
In your software, you would have to detect the error (likely from the error cluster), close down your VISA session, and try to conenct again. Repeat until sucessful. A State Machine would be a good idea of you really need to do this.
06-02-2014 01:28 PM
This is what I tried. I have an idle state reading volt and current from a power supply. I added extra LV code in the idle state to detect errors. If error occurs, the code closes the VISA and open VISA again. To test, I disconnected USB/GPIB cable to the power supply for few seconds and connect it back. It failed in closing VISA (-1073807338) first try and successfully in second try. But it failed in opening VISA with error -1073807194 - Possible reason(s): VISA: (Hex 0xBFFF00A6) The connection for the given session has been lost. In order to work again, I have to stop the appl and restart again going through initialization and setting volt and current and enable output.
06-02-2014 03:44 PM
Don't let your user's near the connections! but them inside a locked cabinet. BETTER, Train them to respect a "Test In Progress" sign. Cause them pain when they fail to do so!
06-03-2014 06:30 AM
@JÞB wrote:
Don't let your user's near the connections! but them inside a locked cabinet. BETTER, Train them to respect a "Test In Progress" sign. Cause them pain when they fail to do so!
That is some of the best advice I have ever heard, Jeff. My other suggestion: avoid USB. I have had too many issues with it wiggling out when dealing with any type of vibration. PCI(e) and GPIB seem to work a lot better.