LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

What happens if I exit my Labview application during a VISA read or write?

 
I am building an application using Labview 8.0, and from my custom menu I'm allowing users to exit the software via the File -> Quite option.  This calls the Item Tag APP_EXIT.  I want to know what happens if another portion of the software is in the middle of a VISA read or write when the software is exited in this manner.  Will the VISA communication end properly?  Will the com port be closed properly?
Thanks.
Steve
0 Kudos
Message 1 of 5
(2,859 Views)
I know that the COM port will not be closed appropriately.  I dont think that the VISA communication will necessarily end correctly, depending on how many bits you are sending, the software could end before all bits are sent.  You should make sure that your software closes out the serial communication before it exits.
0 Kudos
Message 2 of 5
(2,856 Views)

Steve,

You should use the VISA Close.vi before exiting the application.  This will release the port.

 

Missed it by that much!



Message Edited by centerbolt on 07-11-2008 03:52 PM
0 Kudos
Message 3 of 5
(2,852 Views)

As with any software, you should always shut down gracefully.  In the case of VISA communication with the serial port, at a minimum, you would want to close the port.  Otherwise, you will not be able to access it using other software like HyperTerminal.

Also...  remember that using the "Abort Execution" button to stop a running VI does NOT gracefully end the program.  It does not release any resources, such as the COM port.

R

0 Kudos
Message 4 of 5
(2,813 Views)

Thanks everyone for the great information.  I've modified my code to complete all VISA communications in progress and then close out the VISA session.

Steve

0 Kudos
Message 5 of 5
(2,778 Views)