Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I see whether a VISA Session (COM1) is already configured?

Hy 2 @ll.
 
I use a VI that gets a VISA-Session, send and receive data to the COM1-port and give the Session back.
 
I would use it as stand-alone-VI too, so i have to check if the VISA-session to the COM1-Port is already configured and if not i configure the port in the VI.
If not i use the configured port.
 
But which variable show me whether the VISA-session to the COM-port is opened and configured?
Is there a property-value or a register-bit that get this information?
 
Thanks for your Answers.
 
Bernd
---------------------------------
carpe diem et frui noctem
0 Kudos
Message 1 of 2
(2,828 Views)
There is nothing in VISA that says whether a serial port has been configured or not. If you do any VISA action without the VISA Open and the session doesn't already exist, the session will be created automatically anyway. I suppose if you wanted to, whenever you use VISA Configure Serial Port, you could also write to the VISA Property General Settings.User Data but in my tests, reading this property takes about the same amount of time as running VISA Configure Serial Port. Both are in the 20 - 30msec range. You might try timing how long it takes to write/read to a global variable if you really need to save those 10's of milliseconds.
Message 2 of 2
(2,821 Views)