From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Using VISA/TCPIP under LabVIEW6.0

I need to control an instrument with a LAN connection. I am able
detect the device (TCPIP : :192.168.0.4 : :20022 : :SOCKET), write to
and read data from the instrument through the MAX 2.0 VISA session.
When I try to send the same kind of command (e.g. *IDN?\n) using
LabVIEW 6.0 VIs I obtain a timeout error when trying to read from the
instrument. I used Visa open, Visa Write, Visa Read, Visa Close VIs.

What is the difference between these two methods and what should I
change to get the LabVIEW VIs to work?

Regards,

Florent Goldberg
0 Kudos
Message 1 of 3
(2,466 Views)
Hello Florent:

You need to increase the timeout time interval in GPIB read/write vi's since communication is slow over a network. There are example VI's in LabVIEW that do GPIB communication. If you go to the Help menu >> Examples.. >> I/O Interfaces >> GPIB >> "LabVIEW<->GPIB" you will get it. Try tweaking this example.

Hope this helps. If you have any questions, please let us know.

-NI support.
0 Kudos
Message 2 of 3
(2,466 Views)
Florent:

In general, if it works from MAX (Open VISA Session) then it will work from LabVIEW. As the other post suggested, increasing the timeout usually helps, since the default is 2 seconds. Another thing to try is to right-click on the VISA Read node and change it from asynchronous to synchronous. Sometimes this helps.

If that still doesn't work, I suggest sending our support folks 2 log files from NI Spy: 1 from the Open VISA Session, which works; and 1 from LabVIEW, which doesn't. That might help our tech support see what is going on.

Dan Mondrik
Senior Software Engineer, NI-VISA
National Instruments
0 Kudos
Message 3 of 3
(2,466 Views)