Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Slow GPIB performance with NI-488.2 v2.3 driver

Hi CodedoC

I was looking for a driver to simply initialize the box and set some pins to either 'HI' or 'LO'.  I am using LabWindows/CVI, so a C based dll would be fine.

Thanks,

Lasani

0 Kudos
Message 11 of 12
(1,180 Views)
If you are using a GPIB interface, you can simply use a GPIB control in LabVIEW and send a few commands to the IOtech 488/80A.  There are plenty of examples in the manual.  It basically comes down to sending an initialization string (which includes the ports configuration, and command format), and then sending the command to set the pins HI/LO.

The initialization string I use is:  C5P0F0G0K0R0Y3L0X

where...

Config Port 5 Port 4 Port 3 Port 2 Port 1
------ ------ ------ ------ ------ ------
C0     in     in     in     in     in
C1     in     in     in     in     out
C2     in     in     in     out   out
C3     in     in     out   out   out
C4     in     out   out   out   out
C5     out   out   out   out   out

P0 = Select all 5 ports for input/output. Manufacter's default.
F0 = Use ASCII hexadecimal (4-bits per char)  (e.g., the string "A1" is translated to binary 10100001 (decimal 161)). Manufacturer's default.
G0 = Input and output port data are sent when addressed to Talk. Manufacturer's default.
K0 = EOI (End-Or-Identify). Asserts EOI on last byte transferred. Manufacturer's default.
R0 = Don't latch data. Read when whenever addressed. Manufacturer's default.
Y3 = Define line feed ('\n' in c/c++) as the  bus terminator.
L0 = Clears the internal data buffer.
X  = Execute the above commands.

After sending this command, I check and clear any error conditions with the E? command.  Finally, I can send a command to set the pins (this command assumes C5 config.): 

P0XDxxxxxxxxxxZX   where each lower-case "xx" pair is a 2-digit hexadecimal number that represents the bit pattern for that port, starting with port 5, then working down to port 1.
0 Kudos
Message 12 of 12
(1,173 Views)