
3020-XX-UM
ProDAQ 3020 USB2.0 VXIbus Slot-0 Interface User Manual
Page 34 of 60
Copyright, © 2003 Bustec Production Ltd.
The first step in a program, which uses the VISA library, is always to open a session to the
default resource manager (
). It provides connectivity to all VISA resources registered
with it and gives applications control and access to individual resources.
The next step is to open a session to the instrument or multiple sessions to multiple
instruments (
). The resource name used is a combination of interface type and number,
logical address of the VXI device, and a device type:
The interface type for the ProDAQ 3020 USB2.0 VXIbus Interface is always “VXI”. The
interface number is the number, which was assigned to the particular 3020 by using the
VISA configuration utility (see 2.5Configuring the ProDAQ 3020 for the VISA Library). The
logical address of a VXI device is defined either statically by setting its logical address
switch, or dynamically during runtime by the resource manager. If the resource manager
assigned the address dynamically, the actual assignment can be found in the output file of
the resource manager (see 2.7.1 - Running the VXIbus Resource Manager). The device
type for VXI instruments is always “INSTR”.
Note
When running the above example, please make sure that the logical address used
in it matches the logical address setting of the instrument you want to connect to.
Note
Before you can use the above example to connect to your device, you must run the
VXI Resource Manager (see 2.7.1: Running the VXIbus Resource Manager).
3.2 Programming Register-based Devices
Register-based devices are devices implementing a set of registers in A16 and often in
A24 or A32. Programming register-based devices is done by reading and writing these
registers to change their contents, either by bit, in groups of bits or in whole.
3.2.1 Accessing Registers
To access single registers, the VISA library offers two groups of functions. The first group,
viIn8, viIn16, viIn32, viOut8, viOut16, viOut32, provides a standardized, single word
access to a device register in A16, A24 or A32 space. Figure 29 shows an example of a
function reading a value from a device register (
), modifying the value read and writing it
back (
). The driver for the ProDAQ 3020 will automatically take care about byte ordering,
i.e. it will swap the words to be read or written between the little-endian host byte ordering
your PC is using to the big-endian byte ordering used on the VXIbus.
VXI 0 :: 2 :: INSTR
Interface Type
Device Type
Interface Number
Logical Address
Artisan Technology Group - Quality Instrumentation ... Guaranteed | (888) 88-SOURCE | www.artisantg.com