LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

visa

Hi,
I am trying t control several serial devices with labview 8.  I have very little knowledge of visas' and how to program.  I was wondering if someone could help me on how to send hyperterminal style commands and recieve the information from the devices.
Thanks,
Stuart
 
P.S. They are alicate scientific volumetric mass flow controllers if that makes a difference
0 Kudos
Message 1 of 4
(2,570 Views)

If you can make it work in hyperterminal then you should have very little problem writing a program to do the same in labview.  Serial using visa is easy, first function is open a visa session with the resource (COM1 for example) now vias has reserved the resource, next call the serial configure, where you set the the serial settings like parity, baud rate start/stop bits (all provided by the device manual).  Then you send the same command string as you would with hyperterminal using a visa write, put the command in the string wired to the write vi.  If the command is a query (expecting a response from the device) place a visa read command next with the expected bytes for the message to be returned.  Last call the visa close to free the serial resource for other processes to use.  There are some examples of visa in the example finder.  Also search to see if a device driver is already available in labview (Driver network on this site),  studying the driver will teach you how to write a driver in the future.  Writing a device driver using visa sounds harder than it really is.

 

Paul

Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
0 Kudos
Message 2 of 4
(2,563 Views)
And don't forget the termination character! Many instruments require a CR, LF, or both at the end of each command. Hyperterminal sends these automatically. You have to add these yourself when you write your LabVIEW program. The shipping examples show you two different ways. One is to set the string control/constant for '\' Codes Display and the other way is by setting the VISA Property Node to append a termination character.
0 Kudos
Message 3 of 4
(2,558 Views)

Hi Stuart,

Here is some example code that demonstrates how to do a VISA Read and Write.

Sarah

Applications Engineer | National Instruments | UK & Ireland
0 Kudos
Message 4 of 4
(2,536 Views)