Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

How to make a device VISA compatible

An upcoming hardware project I have will involve networked communications. Right now we're looking at using straight TCP, but I think it would be nice to be VISA compatible.

 

A couple questions:

1- Am I correct in assuming the server device (in this case, a BeagleBone) needs to behave differently if using VISA than raw TCP? (I was under the impression VISA could run over TCP, but I'm honestly confused here)

2- I have found a few Linux libraries that'll let me run a TCP server on the Beaglebone. Do I implement VISA as a layer on top of those, or is it a separate layer entirely?

 

I'm a bit confused on what to search for here. The device will need to communicate to devices running any random TCP connection, but I thought VISA would work for this. Am I right, or have I missed the concept completely?

 

As I understand it, VISA abstracts the connection layer, so my device could be connected via TCP or a serial port or a USB cord or whatever. I'm just having a hard time "getting started" with making a device that supports a VISA connection.

0 Kudos
Message 1 of 6
(3,443 Views)

You shouldn't have to do anything special to make it "VISA Compliant".  As you stated, VISA is just a communications abstraction layer.  There is not really anything special it does when it comes to the TCP connection.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 6
(3,361 Views)

Interesting, I thought there might be some sort of enumeration requirements (like finding VISA-compatible devices on a network- I'm not sure if this is actually a "thing" or not).

 

At one point I tried to create a TCP server and connect to it with VISA on the same machine just to try it out, and ran into some issues. I was able to get the connection to talk using TCP primitives but not VISA, and I thought it was because I didn't configure the server to be "discoverable" via VISA but I could be misremembering.

 

Basically, I've done a good amount of talking to instruments from Windows using VISA, but not the reverse, and I'm having a bit of trouble fully understanding what would go into the server side of things. It sounds like I can just use basic TCP connections and call it good... which is a good thing to understand, as basically every resource online quickly gets into discussing IVI/LXI compatibility, and mentioning abstract standards that I'm not familiar with 🙂

0 Kudos
Message 3 of 6
(3,345 Views)

Visa supports 3 different TCPIP protocols.

  1. Raw socket which is what you are doing now. Problem with this is you need to handle making sure the server/client understand when there is no more data available. This is where in Visa you enable the termchar (linefeed by default).
  2. VXI-11. This protocol has a discovery mechanism. A client wishing to discover instruments sends a broadcast packet to port 111. Inside the packet is a code which designates the type of instruments to respond (basically a code that says anyone understanding this protocol please respond). The client then waits x amount of time waiting for responses and it now has a list of instruments. When you do a Find Instruments in NI Max this is what's going on for VXI-11 devices.
  3. HiSLIP was designed to be a slim layer (fast) on top of raw sockets. VXI-11 is very heavy weight (SUN RPC) plus it doesn't work on IPv6 networks. HiSLIP does not have a discovery mechanism they rely on mDNS protocol which Apple developed to replace AppleTalk to discover peripheral devices. Apple's implementation is called Bonjour and the one in Linux distros is called Avahi

No 3 is the way to go now a days. There are mDNS stacks and implementations available beside the Bonjour and Avahi ones. HiSLIP is a standard at Ivifoundation.org. Look at this guys website fro HiSLIP info/code: https://kiener-muenchen.de/hislip/

Message 4 of 6
(3,326 Views)

@cymrieg wrote:

Visa supports 3 different TCPIP protocols.

  1. Raw socket which is what you are doing now. Problem with this is you need to handle making sure the server/client understand when there is no more data available. This is where in Visa you enable the termchar (linefeed by default).
  2. VXI-11. This protocol has a discovery mechanism. A client wishing to discover instruments sends a broadcast packet to port 111. Inside the packet is a code which designates the type of instruments to respond (basically a code that says anyone understanding this protocol please respond). The client then waits x amount of time waiting for responses and it now has a list of instruments. When you do a Find Instruments in NI Max this is what's going on for VXI-11 devices.
  3. HiSLIP was designed to be a slim layer (fast) on top of raw sockets. VXI-11 is very heavy weight (SUN RPC) plus it doesn't work on IPv6 networks. HiSLIP does not have a discovery mechanism they rely on mDNS protocol which Apple developed to replace AppleTalk to discover peripheral devices. Apple's implementation is called Bonjour and the one in Linux distros is called Avahi

No 3 is the way to go now a days. There are mDNS stacks and implementations available beside the Bonjour and Avahi ones. HiSLIP is a standard at Ivifoundation.org. Look at this guys website fro HiSLIP info/code: https://kiener-muenchen.de/hislip/


Great info, thanks. I will read up on HiSLIP. It looks like my instrument (the server) will need to support HiSLIP, but that's something different than VISA (which the client will use, right?).

 

A quick Googling didn't seem to show many standard libraries for implementing HiSLIP on Linux (in my case, a Beaglebone acting as the server). Any tips on where to go from here? This is quite new to me, so just some search terms or example projects would help tremendously. I can handle the LabVIEW side but we don't have anyone at the office who is very proficient in Linux. At the moment we're hoping to just use the Beaglebone as "passthrough" to get some legacy Serial devices network-compatible. After that's working we'll try to switch to a more unified approach with our newer devices.

0 Kudos
Message 5 of 6
(3,317 Views)

Well in that case I would just stick with socket communication for now. In Visa you just call viOpen with a resource of something like: "tcpip0::1.2.3.4::5025::socket"

Where 1.2.3.4 is the ip address and the next number is the port number. 5025 is pretty standard for scpi based instruments but you can pick another one.

By using the Write and Reads in Visa if you do change the instruments out it, in the future, it should just work. All you need to do is change the Visa resource string. Plus the commands probably unless you get the exact same instrument on LAN or USB instead of the serial ones you have now.

 

0 Kudos
Message 6 of 6
(3,305 Views)