Specifications
Customizing the System 61Chapter 3
Naming
Conventions Used
in Instrument
Handlers
Instrument handlers follow these naming conventions:
1. Routine names begin with the lowercase name of the instrument type.
Note that this is not a specific device, but a generic one. For example,
use ‘
dmm’ instead of ‘dmm1411’. This lets handlers be expanded to
handle more than one type of similar instrument in the future.
2. There are no underscores separating parts of a function name. Rather,
upper and lower cases are used.
3. Functionality that is unique to an instrument has a name that matches
the function. For example, to source DC current, the handler for
instrument ‘
vi’ is named ‘viConfSourceDCI'.
4. The name of the instrument is always the first parameter, and it is of
type
HINSTR, which is a handle to the given instrument. When the
system software begins to run, the hardware configuration table,
hwconfig, is constructed. Every action routine that uses an instrument
must have the handle to that instrument passed to it.
5. If multiple instruments exist on a card or logical unit, they are
assigned different instrument names. They are generated by the
handler from parameters in pblock and appear as separate modules.
For example, the Agilent E6173A Arbitrary Waveform Generator
module actually has two separate generators on it. These would
typically be named ‘
arb1’ and ‘arb2’.
Multiple instruments on a card are not completely separate, therefore
some commands affect both instruments. For example, ‘
reset’
cannot reset just one of the generators. Any of the instrument names
on a card can be used, and you must remember that all subinstruments
will be affected.
6. Header files exist for each instrument type, and they define the
function calls available for that handler. Also, constants specific to
that instrument are contained in the header file. All constants are
prefaced by the letters FT_ (for Functional Test) to avoid conflicts
with user-defined symbols in action routines. Thus, you should avoid
using the FT_ prefix on user-defined constants. File ‘
handler.h’
contains constants applicable to more than one instrument and other
common information.
7. Common functions used by many types of instruments use consistent
names. Although the parameters used by these routines may vary by
instrument type, the names themselves are consistent.
8. Because of system buffering, no command can be assumed to have
been actually sent to the instrument until a Set statement has been
issued and the IsSet routine has returned true.
Artisan Technology Group - Quality Instrumentation ... Guaranteed | (888) 88-SOURCE | www.artisantg.com