HP (Hewlett-Packard) Drive Network Card User Manual


 
Advanced Topics
111
The rest of the code follows that used for the examples, but note that it is written to
the class-compliant interfaces, not the instrument-specific ones.
dmm.Configure(IviDmmFunctionEnum.IviDmmFunctionDCVolts, 1.5,
0.001);
dmm.Trigger.Delay = 0.01;
Console.WriteLine(dmm.Measurement.Read(1000).ToString());
dmm.Close();
IVI-C
This C example shows how to use an IVI-C Class Driver to achieve
interchangeability. It is very similar to the IVI-C examples in Chapters 2 and 5
except for 3 differences:
1 The function calls are all for the class driver and do not refer to the particular
instrument being used, e.g., IviDMM_Read vs. HP34401A_Read
2 The parameters in certain function calls are generic for the instrument class
and do not refer to the particular instrument being used, e.g.,
IVIDMM_VAL_DC_VOLTS vs. HP34401A_VAL_DC_VOLTS
3 The initialize function refers to a logical name instead of the instruments
physical address, in this case “SampleDMM” vs. “GPIB0::23::INSTR”
In order to interchange a different DMM for the Agilent 34401A DMM, you would
update your configuration store to have the logical name “SampleDMM” point to the
new instrument’s Driver Session.
This is what the code for the example used in this guide would look like using and
IVI-C class driver.
static ViReal64 reading;
static ViSession session;
IviDMM_InitWithOptions ("SampleDMM", VI_FALSE,
VI_TRUE,"Simulate=1", &session);
IviDMM_ConfigureMeasurement (session, IVIDMM_VAL_DC_VOLTS,
1.5, 0.001);