LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to set Timeout when Do VISA Open for TCPIP

I use Visa open to init TCPIP connection. If the connection could not be established, I like to return error in a short time( a few seconds) instead of wait for 1 minute(default). Even I set Timeout property, it does not work properly. LabVIEW I used is LabVIEW 6i. Thanks for any suggestion.
0 Kudos
Message 1 of 4
(3,828 Views)
You may also want to try setting the timeout value that is wired into the VISA Open vi.

Chris
0 Kudos
Message 2 of 4
(3,828 Views)
What I did was, I used the NI-MAX 2.0.3.6 and NI-VISA 2.5 to configure the Target Device as TCPIP0 with it's Address and Socket number or Port number. After that I created a simple VI with VISA OPEN, WRITE, READ and CLOSE. On the VISA Resource name you can use "TCPIP0::IP-address::PORT#::SOCKET" and Right Click on the Resource and select VISA Class->I/O Session->TCP/IP SOCKET. and you are all set to talk to the instrument. Make sure when you write or send a string to the instrument add "Carriage Return" with it. Normally, GPIB/RS-232 does not require this "CR".
0 Kudos
Message 4 of 4
(3,828 Views)
LL:

What you see is a known bug in NI-VISA 2.5.x, including the version that shipped with LabVIEW 6i. In NI-VISA 2.6 (currently in beta) we use the value in the openTimeout parameter as you would expect. This parameter is the one wired up to VISA Open, and is different from the I/O timeout. If 0 is passed as the openTimeout value, NI-VISA 2.6 will wait for no more than 2 seconds while attempting to connect to the TCPIP resource.

Dan Mondrik
Senior software Engineer, NI-VISA
National Instruments
Message 3 of 4
(3,828 Views)