IVI Configuration Store
Benefits of IVI Configuration Store
By providing a way to configure the relationship between drivers and I/O references, an IVI® configuration store greatly enhances instrument interchangeability.
Suppose your code uses only a specified driver to communicate with one type of instrument at a fixed location. If you change the instrument model, instrument location, or driver, you would have to modify the code to accommodate that change.
An IVI configuration store offers the ability to accommodate different instrument models, drivers, or ports, without having to modify your code. This interchangeability is especially useful when you use code that cannot be easily modified.
Components of IVI Configuration Store
The components of an IVI configuration store identify:
Locations of the instruments to communicate with
Software modules used to control the instruments
Associations of software modules used with instruments at specific locations
Component | Description |
---|---|
Software module | A software module is instrument-specific, and contains the commands and functions necessary to communicate with the instrument. The instrument vendor commonly provides software modules, which you cannot edit from the MATLAB® Command Window. |
Hardware asset | A hardware asset identifies a communication port connected the
instrument. Configure this component with an
|
Driver session | A driver session makes the association between a software module and a hardware asset. Generally, you have a driver session for each instrument at each of its possible locations. Identical instruments connected at different locations can use the same software module, but because they have different hardware assets, they require different driver sessions. Different kinds of instruments connected to the same location (at different times) use the same hardware asset, but can have different software modules. Therefore, they require different driver sessions. |
Logical name | A logical name is a configuration store component that provides access to a driver session. You can interpret a logical name as a configurable pointer to a driver session. In a typical setup, the code communicates with an instrument via a logical name. If the code must communicate with a different instrument (for example, a similar scope at a different location), update only the logical name within the IVI configuration store to point to the new driver session. You need not rewrite any code because it uses the same logical name. |
Configuring IVI Configuration Store
You can use command-line functions to examine and configure your IVI configuration store. To see what IVI configuration store elements are available, use instrhwinfo
to identify the existing logical names.
instrhwinfo('ivi')
ans = LogicalNames: {'MainScope', 'FuncGen'} ProgramIDs: {'TekScope.TekScope','Agilent33250'} Modules: {'ag3325b', 'hpe363xa'} ConfigurationServerVersion: '1.6.0.10124' ConfigurationStoreLocation: 'C:\Program Files\IVI\Data\ IviConfigurationStore.xml' IVIRootPath: 'C:\Program Files\IVI\'
Use instrhwinfo
with a logical name as an argument to see the details
of the configuration.
instrhwinfo('ivi','MainScope')
ans = DriverSession: 'TekScope.DriverSession' HardwareAsset: 'TekScope.Hardware' SoftwareModule: 'TekScope.Software' IOResourceDescriptor: 'GPIB0::13::INSTR' SupportedInstrumentModels: 'TekScope 5000, 6000 and 7000 series' ModuleDescription: 'TekScope software module desc' ModuleLocation: ''
You can use the command line to change the configuration store. Here is an example of changing it programmatically.
% Construct a configStore. configStore = iviconfigurationstore; % Set up the hardware asset with name myScopeHWAsset, and resource descriptor TCPIP0::a-m6104a-004598::INSTR. add(configStore, 'HardwareAsset', 'myScopeHWAsset', 'TCPIP0::a-m6104a-004598::INSTR'); % Add a driver session with name myScopeSession, and use the asset created in the step above. Ag546XX is the Agilent driver. add(configStore, 'DriverSession', 'myScopeSession', 'Ag546XX', 'myScopeHWAsset'); % Add a logical name to the configStore, with name myScope and driver session named myScopeSession. add(configStore, 'LogicalName', 'myScope', 'myScopeSession'); % Save the changes to the IVI configuration store data file. commit(configStore); % You can verify that the steps you just performed worked. logicalNameInfo = instrhwinfo('ivi', 'myscope')
Basic IVI Configuration Store
The following is an example of the configuration used by
data_analyzer.m
.
Create and configure elements in the IVI configuration store using the IVI configuration store object functions add
, commit
, remove
, and update
.
IVI Configuration Store with Several Interchangeable Elements
The following figure shows an example of an IVI configuration store with several interchangeable components. Code 1 requires access to the oscilloscopes at two different
locations (hardware asset X
and hardware asset Y
).
The scopes are similar, so they use the same software module S
. Here,
the scopes are at different locations (or the same scope connected to two different
locations at different times). Therefore, each configuration requires its own driver
session, in this example, driver session A
and driver session
B
.
Write Code 1 to access logical name
1
. You configure the name in the IVI configuration store to access driver session A
or driver
session B
(but not both at the same time). Because you select the
driver session in the IVI configuration store, you need not alter the code to change access from one
scope to the other.