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: 

how do I specify an IP address as the visa resource name

I'm trying to talk to an Agilent 34220A and found instrument drivers for this on ni.com.  However, I am not connected to my device using GPIB or USB.  The instrument is on a network and has an IP address (10.7.0.47).  Can this IP address be directly used as a VISA resource name?  If not, what format should I use?  I know the instrument is working because when I open this address in Internet Explorer, I am able to control the device.

 

S G
Certified LabVIEW Architect, Certified TestStand Architect, Certified Professional Instructor
0 Kudos
Message 1 of 12
(8,797 Views)

Yes. From the LabVIEW Help:

 

TCPIP[board]::host address[::LAN device name][::INSTR]

 

Example: TCPIP0::1.2.3.4

 

Not to be blunt, but, errr... shouldn't a LabVIEW Architect know this?

0 Kudos
Message 2 of 12
(8,791 Views)

Here is what I used for my scope.

 

MAX link

Message 3 of 12
(8,790 Views)

smercurio, if the solution was as easy as you suggested, I wouldn't have posted my question on this forum.

I finally got it to work, but in an unexpected way.  Here's a more detailed description, and you can decide for yourself if the question warranted posting.

 

When I used any of the following, communication failed.

TCPIP0::host address

TCPIP0::host address::inst0::INSTR

TCPIP::host address::inst0

 

Communication worked when I used

TCPIP0::host address::INSTR

 

Keep in mind that according to the specification from the LabVIEW Help, the [board] is optional and has a default value of 0, [::LAN device name] is optional and has a default value of inst0, and the [::INSTR] is also optional.  Yet the first 3 cases don't work, and the last one does.  I still don't know why this is the case, but I discovered this only through trial and error.

S G
Certified LabVIEW Architect, Certified TestStand Architect, Certified Professional Instructor
0 Kudos
Message 4 of 12
(8,763 Views)
What format was listed in VISA Resource Control for you to select from?
0 Kudos
Message 5 of 12
(8,752 Views)

S G wrote:

smercurio, if the solution was as easy as you suggested, I wouldn't have posted my question on this forum.

I finally got it to work, but in an unexpected way.  Here's a more detailed description, and you can decide for yourself if the question warranted posting.

 

...

Well, that's a little different, now. You have to admit that your original post made no mention of what you had tried, and all that you had asked was a general question whose answer could be found in the LabVIEW Help. This is what I found somewhat surprising.

0 Kudos
Message 6 of 12
(8,731 Views)

I had never problems to use TCPIP::host address::SOCKET but that was for raw communication and I have since long time refrained from using VISA for TCPIP raw connections because in a 24 hour/7 day setup it did not always perform reliably for network connections. Using the build in LabVIEW primitives instead for raw TCP/IP communication allowed me much better to get the communication working and working reliable.

 

And I have a feeling that TCPIP::host adress would work for an Instrument resource that is connected to the default network card.

 

Rolf Kalbermatter

Message Edited by rolfk on 07-23-2009 07:35 AM
Rolf Kalbermatter
My Blog
0 Kudos
Message 7 of 12
(8,722 Views)

Hello Rolf,

what problems did you find using VISA for raw TCP?

I also got into troubles some times ago: the polling rate was slowing down more and more with time, so I had to change some parts of the software: now it seems to work good (at least, good enough for me).

I used VISA because the instrument could be connected through Ethernet or serial with the same protocol, and I wanted to used the same vi's. Of course, I needed to make some minor changes in case of Ethernet connection.

Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
0 Kudos
Message 8 of 12
(8,714 Views)

Well it is quite some time ago and with older versions of VISA so I'm pretty sure it got better in the meantime. Problems I had were several such that at high network load the communication started to get unreliable without error indication whereas doing the same with LabVIEW did either work or return errors.

 

Another issue I had, probably due to dynamic DHCP IP adressing was that at times the resource simply lost the connection to the remote side without any error indication. I could continue to send data to now end without any error indication at all. Reconnection for each data packet was not practical since there was quite some status traffic going on, and I had simply relied on the proper error indication to close and reconnect in error cases only. I had been choosing VISA TCPIP at that point becasue the applciation had slowly evolved from all RS-232 devices to some using TCP/IP including to other LabVIEW applications that were automating a particular task of the labor automation system.

 

Reimplementing the entire communication to use the native TCP/IP nodes instead was no trivial task either but with a bit of trial and error I got a fully reliable connection in that way.

 

Rolf Kalbermatter

Rolf Kalbermatter
My Blog
0 Kudos
Message 9 of 12
(8,710 Views)

Thanks for the info, Rolf.

Definitely not the same problems I noticed. I also used an old VISA version (3.1).

In one case I found that simply reading a VISA general property while initializing the resource caused the communication to be impossible (no response received)!!

 

S G, sorry for hijacking your thread, I will not get further into it.

 

Good G-ob to all!

Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
0 Kudos
Message 10 of 12
(8,699 Views)