LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

What is the syntax for sending GPIB commands (multiline interface messages) in LabVIEW?

I am trying to address the bus as a listener, but am not sure what is the syntax to send the MLA0 command. Should I be using the VISA GPIB command VI? Do I need to send the text string in quotations? hex-encoded?

Any help is appreciated,
Chris
0 Kudos
Message 1 of 5
(4,656 Views)
The multiline interface messages consist of a single byte that you write to the GPIB bus in parallel. Do a search of the LV online documentation and you'll find a table of the character values for the various commands. The MLA0 command is as ASCII space (32 decimal, 20 Hex).

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 2 of 5
(4,656 Views)
Hi,

Although the multiline messages are sent using the data lines, the ATN line on the GPIB bus has to be asserted to indicate to the devices that these are bus addressing commands. It is when the ATN line is asserted that the GPIB interface acts as controller.

Using VISA you need to use the "VISA GPIB Command.vi" in the 'Instrument I/0 >> VISA >> VISA Advanced >> interface specific' palette. This VI will assert the ATN line and send the string of commands. You can write the commands in a byte array and then use the "byte array to string.vi" to send them.

Another important point is the resource descriptor. Notice that when you are using the VISA Read and write VIs the resource descriptor includes the GPIB device bus address, this allows VISA
to automatically address the bus. Multilines messages are not specific to any device on the bus. You need to use a interface resource descriptor, such as GPIB0::INTFC. Additionally you need to change the class of the VISA control to "GPIBBoardInterface". Just right click on the control and browse through the context menu.

DiegoF
National Instruments.
0 Kudos
Message 3 of 5
(4,656 Views)
Hi Diego,

Thanks for the clarifications. It looks like I have the right idea as far as the set up the VIs is concerned, however, I am a little confused as to the byte array part.

Is the byte array just a series of \[hex code] entities representing the multiline interface message I would like to send? Could I not just write the ASCII characters in a string constant and wire it to the command input?

For example,
Operation 1:
I want my LabVIEW program, which is on the computer with the GPIB card (GPIB0) to send data to the instrument (PAD of 1).

Operation 2:
Then have the instrument output the measurement when finished.

I have decided I need to address the GPIB0 as talker and the instrument as listener for Operation 1. Operation 2 will
require GPIB0 to be listener and the instrument to be talker.

To accomplish this, I send a string constant of _?@! before the VISA write and _? A before the VISA read.

_? will untalk and unlisten the bus and devices.
@ makes PAD 0 talker
! makes PAD 1 listener
(SP) makes PAD 0 listener
A makes PAD 1 talker

Is this correct?

Thanks for the confirmation,
Chris
0 Kudos
Message 4 of 5
(4,656 Views)
Hi,

You are right, you can use the string without any problems. You are basically sending the send numerical values. I always mention the byte array option, since it sometimes provides a better way of seeing what's being sent.

DiegoF
National Instruments.
0 Kudos
Message 5 of 5
(4,656 Views)