Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Controlling Custom Instrument over Ethernet

I'm trying to setup the communication for a custom made instrument programmed in LabVIEW.  I would like my instrument to communcate with a PC over VISA like I do with my typical COTS equipment.  

 

Does anyone know a good standard way I can set this up?  The way agilent or a real company does?

I tried using VISA VIs in the instruments code, but I could never get a command from the instrument to the PC.  Not sure if that's even possible since the PC isn't set up as a resource in MAX.  I just used the know IP address and port and hoped it would work.  

I also tried using the TCP VIs which did work, but the commands send between the instrument and PC have a lot of time between them.  I didn't know if leaving a TCP connection open would work.  Seemed like it would just timeout after x amount of time (1min?).

0 Kudos
Message 1 of 5
(4,319 Views)
I don't understand what you mean by a custom instrument. You mention including VISA VIs in the instrument and the pc is not a resource. That sounds like you don't have an instrument but a pc. Custom instruments are not programmed in LabVIEW.

Instruments from Agilent, etc., have firmware that implement the VXI11 or LXI standard.
0 Kudos
Message 2 of 5
(4,315 Views)

The instrument is made in-house and uses an NI touch panel to run a LabVIEW .exe program.  The touch panel is used interface to the user via the touch panel display or remotely through a PC.  I'm just trying to have it talk to the PC in a similar way as a typical instrument does, so it's easy to use.

 

But really, you're correct the touch panel is a PC that is running XP embedded.

 

(Also I'm not too familiar with TCP/general comm protocol, so feel free to state the what seems like the obvious because I am learning as I go with this.)

 

Thanks for the reply!

0 Kudos
Message 3 of 5
(4,300 Views)
I would just treat it as 2 different pc's connected via an Ethernet cable and use the TCP/IP functions. On both, you would have a VI that both sends and receives messages. You would have to design your own message protocol - a command followed by data for example.

VISA also could be used I think. Did you try going into MAX and adding a TCP/IP resource? This has to be done manually.
0 Kudos
Message 4 of 5
(4,296 Views)

I recommend using the Simple Messaging Reference Library.  It is a really good library for simple communication between two computers.  I have used it for several projects.  It is also available on the LabVIEW Tools Network and VIPM.


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 5 of 5
(4,285 Views)