Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Visa Session Issue

Hi,
 
We recently upgraded our application from LabVIEW 6.1 to 8.0 and TestStand 2.0 to 3.5. NI Visa 3.5 is installed and I have observed some problems when more than one serial device is connected. 
It's related to the Visa session number - after the first serial device is initialized using 'Old Visa Open', a session number is obtained. Later, second serial device is initialized and it seems to have the same session number as the first one. Due to this, communication with the first serial device is lost.  
 
This problem was not observed with LV 6.1 and TS 2.0. Any suggestions/comments are appreciated.
 
Thanks.
 
 
0 Kudos
Message 1 of 6
(4,158 Views)
"Old VISA Open" should not be used. I'm surprised it worked with your old version of VISA but it's certainly not compatible with the current version of VISA. Right click on every instance and replace with the VISA Open on the palette. You will need to delete the string that was used before and replace it on the connector pane with the VISA Resource Name.
0 Kudos
Message 2 of 6
(4,147 Views)
Thanks.
I did modify the VI, but the second serial device seems to get the same session number as the first one.
String is used to pass the comm port number of the devices that is connected, since it is entered by the user in the top level GUI.
 
I also tried changing duplicate session value, but it didn't seem to help.
 
 
0 Kudos
Message 3 of 6
(4,132 Views)
Can you save it as 7.1? You can pass a string to a VISA Resource Name control. When you probe the output of VISA Open, do you also get the same Canonical VISA resource name?
0 Kudos
Message 4 of 6
(4,130 Views)
I had some problems saving it in 7.1 (due to other dependent VIs). 'Visa open' seems to be similar to the one in 8.0.
String is being passed as VISA Resource name control.
 
Canonical Visa Resource name is similar to VISA Refnum. When I probed the output after Serial device 1 and Serial device 2, VISA refnum (and Canonical Visa res. name) were different, however session ID was the same. I have attached the images.
 
Thank you.
Download All
0 Kudos
Message 5 of 6
(4,125 Views)
After taking a closer look at the sequence file, I found that before the comm port is opened, it is closed (to ensure the comm port is not already open).  When the step was skipped, both the serial devices had unique visa session numbers.  
 
I've attached the VI that is being used to close the comm port. I still can't understand as to how it worked with LabVIEW 6.1.
 
Any comments/suggestions are appreciated. Thanks.
 
0 Kudos
Message 6 of 6
(4,072 Views)