Extensions for multiple interfaces – Measurement Computing Personal488 rev.3.0 For DOS & Windows 3.Xi User Manual
Page 160

II. SOFTWARE GUIDES - 9. Driver488/SUB
9C. External Device Interfacing
Personal488 User’s Manual, Rev. 3.0
II-145
Output(adc, “A0 C1 G0 R3 T0 X”) ;
// Set up ADC488
Enter(adc,data) ;
printf (data) ;
ClearList (deviceList) ;
// Send a Selected Device Clear (SDC) to a list
Close (adc) ;
// Close ADC488. Handle is now unavailable for
// access.
If we tried to call
Output
by sending the handle
adc
without first opening the name
ADC
, an error
would result and
Output
would return a
-1
as shown below:
result = Output (adc, “A0 C1 G0 R3 T0 X”);
printf (“Output returned: %d.\n”,result);
should print:
Output returned: -1.
As mentioned above, named devices have another advantage: they automatically use the correct bus
terminators and time out. When a named device is defined, it is assigned bus terminators and a time
out period. When communication with that named device occurs, Driver488/SUB uses these
terminators and time out period automatically. Thus
Term
commands are not needed to reconfigure the
bus terminators for devices that cannot use the default terminators (which are usually carriage-return
line-feed
EOI
). It is still possible to override the automatic bus terminators by explicitly specifying the
terminators in an
Enter
or
Output
command, or to change them semi-permanently via the
Term
command. For more information, see the
Enter
,
Output
, and
Term
commands described in
“Section III: Command References.”
Extensions for Multiple Interfaces
Driver488/SUB allows the simultaneous control of multiple interfaces each with several attached
devices. To avoid confusion, external devices may be referred to by their “full name” which consists of
two parts. The “first name” is the hardware interface
name
, followed by a colon separator (
:
). The
“last name” is the external device
name
on that interface. For example, the “full name” of
DMM
might
be
IEEE:DMM
.
Duplicate Device Names
Duplicate device names are most often used in systems that consist of several identical sets of
equipment. For example, a test set might consist of a signal generator and an oscilloscope. If three test
sets were controlled by a single computer using three separate IEEE 488 interfaces, then each signal
generator and each oscilloscope might be given the same name and the program would specify which
test set to use by opening the correct interface (
OpenName(“IEEE”)
for one,
OpenName(“IEEE2”)
for the other), or by using the interface names when opening the devices
(
OpenName(“IEEE:GENERATOR”)
for one and
OpenName(“IEEE2:GENERATOR”)
for the other).
Unique names are appropriate when the devices work together, even if more than one interface is used.
If two different oscilloscopes, on two different interfaces are used as part of the same system, then they
would each be given a name appropriate to its function. This avoids confusion and eliminates the need
to specify the interface when opening the devices.
Access of Multiple Interfaces
If the computer only has one IEEE 488 interface, then there is no confusion, for every external device
is known to be on that interface. As noted above, duplicate device names on one interface are not
recommended; if they exist, the most recently defined device with the requested name will be used.
When more than one interface is available and duplicate names appear on different interfaces, the
following rules apply:
1.
If the external device name is specified without its interface name, then any external device with
that name may be used. If more than one external device has that name, then the choice of which
particular external device is not defined.