Appendix A
Using the NI-VISA Code Instrument
A-2
ni.com
because the device is VXI—to get a handle to it. The simplest and most
common GPIB-VXI resource string is "
GPIB-VXI::<logical
address>::INSTR
". Once you have a session to the VXI device, the
NI-488 and VISA calls to communicate with the device are very similar.
Register-Based Access with VISA
Because register accesses using the GPIB-VXI involve sending requests to
the controller itself (using the local command set), NI-488 programs would
use
ibdev()
with the GPIB-VXI
controller’s
primary and secondary
GPIB addresses. In VISA, you call
viOpen()
with the VXI
device’s
logical address—
the same method for both message-based and
register-based devices
—and VISA handles sending the necessary
messages to the controller. For programming the device, the following
NI-488 messages and VISA operations are roughly equivalent.
Table A-1.
Register-based Programming Messages and Operations
NI-488 Message
VISA Operation
“Laddrs?”
or “DLAD?”
viFindRsrc()
“RMentry?”
or “DINF?”
viGetAttribute()
“Cmdr?”
viGetAttribute()
with
VI_ATTR_CMDR_LA
“LaSaddr?”
viGetAttribute()
with
VI_ATTR_GPIB_SECONDARY_ADDR
“Primary?”
viGetAttribute()
with
VI_ATTR_GPIB_PRIMARY_ADDR
“WREG”
or “A16”
viOut16()
with
VI_A16_SPACE
“RREG?”
or “A16?”
viIn16()
with
VI_A16_SPACE
“A24”
viOut16()
with
VI_A24_SPACE
“A24?”
viIn16()
with
VI_A24_SPACE
“SrcTrig”
viAssertTrigger()