Recently, I was working on a project about the tr component automatic testing system, in which I wanted to use IVI to set the testing system and instrument. Most of the new instruments support LAN ports, manufacturers all come with their own IVI drivers. As long as you follow the specified steps, you can implement IVI instrument settings for multiple manufacturers to achieve interchangeable similar instruments.
This project uses oscilloscope, analyzer, broadband signal source, microwave signal source and other instruments. The following describes how to develop IVI:
1, first of all to understand IVI, IVI information can be obtained from the following URL: http://www.ivifoundation.org/default.aspx
- In overview, you can learn the definition of IVI and understand the benefits of IVI.
The IVI standards define an open driver architecture, a set of instrument classes, and shared software components. Together these provide critical elements needed for instrument interchangeability.
- Shows the structure of IVI:
IVI driver types are IVI-C, IVI-COM, drivers communicate through the I/O Library and hardware, the two support upper-layer development languages are not the same, I am using C # development so all IVI drivers in the project select the IVI-COM type.
Driver API
To support all popular programming languages and development environments, IVI drivers provide either a IVI-C or an IVI-COM API. Driver developers may provide both interfaces, as well as wrapper interfaces optimized for specpacific development.
Instrument I/O
All IVI drivers communicate to the instrumentation hardware through an I/O Library. The visa library is used for the GPIB and VXI buses, while other buses can either utilize visa or another library.
Shared Components
IVI Foundation members have cooperated to provide common software components, called IVI shared components, that ensure multi-vendor system compatibility. these components provide services to drivers and driver clients that need to be common to all drivers. for instance, the IVI configuration server enables administration of system-wide configuration.
2. Download the IVI driver
All classes
Custom
Iviacpwr
Ivicounter
Ividcpwr
Ividigitizer
Ividmm
Ividownconverter
Ivifgen
Ivipwrmeter
Ivirfsiggen
Iviscope
Ivispecan
Iviswtch
Iviupconverter
The above are several types of IVI instruments currently supported by IVI.
IVI shared components can be downloaded on this website. For most of the devices that you usually use, you can download software from the website of anjet.
Io libraries suite 16.3 Update 2
Http://www.home.agilent.com/agilent/software.jspx? Cc = cn & lc = Chi & nid =-33330.977662 & id = 2175637
After downloading and installing this Io library, the IVI shared component is automatically installed.
IVI shared component mainly supports the consistency of multiple manufacturers' instruments. After installing the I/O library, you need to install the IVI driver for each instrument. You may ask: How do I know whether my instrument supports IVI? Is there an IVI driver? This can be viewed from the "Driver Registry" page on the http://www.ivifoundation.org/default.aspx website, but all IVI drivers that support IVI manufacturers will be listed, as long as you find from this list whether you want IVI-C or IVI-COM driver, and then click the link to enter the relevant vendor official website to download the corresponding driver.
For example, if you want to find the IVI driver of's awg7122c, the result is as follows:
3. Install the driver, configure the development environment one by one according to the driver help file, add the specified com reference, and enter the development and call. This project is developed in C #. C # is used as an example.
Remember the software installation sequence:
Install the IO libraries suite Library first, and then install the IVI driver of a single instrument. You have downloaded the IVI driver of awg7122c. After installation, you can open C: \ Documents and Settings \ All Users \ Application Data \ IVI Foundation \ IVI \ iviconfigurationstore. XML. The driver information is displayed in the iviconfigurationstore file.
The driver Installation File and help information will also be displayed in the corresponding IVI installation path: C: \ Program Files \ IVI Foundation \ IVI \ drivers \ tekfgen
After the Help file is opened in this directory, detailed driver development steps, COM components to be introduced, and simple call examples will be provided ,:
4. Compile the IVI iviconfigurationstore. xml file.
You can refer to the help document to write the program that calls the IVI driver interface. In the program writing, you will find that when introducing interchangeable programming, the example mentions "mylogicalname ", this is very important. We need to do a good job in advance, that is, write the iviconfigurationstore mentioned above. XML file.
// If true, this will query the instrument model and fail Initialization
// If the model is not supported by the driver
Bool idquery = false;
// If true, the instrument is reset at Initialization
Bool reset = false;
// Setup IVI-defined initialization options
String standardinitoptions =
"Cache = true, interchangecheck = false, querymediastatus = true, rangecheck = true, recordcoercions = false, simulate = false ";
// Setup driver-specific initialization options
String driversetupoptions =
"Driversetup = model = awg7052, trace = false ";
Fgen. initialize ("mylogicalname", idquery, reset, standardinitoptions + "," + driversetupoptions)
When calling each driver, you must input a logicname, which is written in the configuration file iviconfigurationstore. The Calling process reads the physical address and driver information of the relevant device from this file.
The following is a simple example of Calling C # program and configuration file of awg7122c:
C # program call: (initialize the instance and call to generate a sine wave)
Iivisessionfactory factory = new ivisessionfactoryclass ();
;
Iivifgen siggen = (iivifgen) Factory. createdriver ("awg7122c"); // logicname ---- awg7122c
Try
{
Siggen. initialize ("awg7122c", false, false ,"");
// Get a string Property
String description = siggen. Identity. description;
Siggen. initiategeneration ();
Siggen. Arbitrary. waveform. Configure ("success,", 0x00000001, 0.1, 0.2); // configure Channel 1 to output the waveform, 0x00000001 ---- waveform number
Siggen. Arbitrary. samplerate = 24;
Siggen. Trigger. Fig = 0.3;
Siggen. Output. set_operationmode ("operationmode", ivifgenoperationmodeenum. ivifgenoperationmodecontinuous );
Siggen. Output. set_enabled ("enabled", true );
Siggen. Trigger. sendsoftwaretrigger ();
// Close the session
Siggen. Close ();
Return true;
}
Catch (exception E)
{
Console. writeline (E. tostring ());
Return false;
}
Corresponding Configuration File Settings: hardwareassets, driversessions, and logicalnames are manually added. ioresourcedescriptor is the visa string found through aglient connection expert. For details about the relevant information, you can refer to the specifications page on the http://www.ivifoundation.org/default.aspx
IVI specifications Documentation.
<Hardwareassets>
<Ivihardwareasset id = "p179">
<Name> awg7122c </Name>
<Description> Resource Name for arbitrary waveform generators </description>
<Datacomponents/>
<Ioresourcedescriptor> tcpip0: AWG-3289382193: inst0: instr </ioresourcedescriptor>
</Ivihardwareasset>
</Hardwareassets>
<Driversessions>
<Ividriversession id = "p183">
<Name> awg7122c </Name>
<Description> logic name for arbitrary waveform generators </description>
<Datacomponents/>
<Ivihardwareasset idref = "p179"/>
<Ivisoftwaremoduleref idref = "p176"/>
<Virtualnames/>
<Softwaremodulename> awg7122c </softwaremodulename>
<Cache> 0 </cache>
<Driversetup/>
<Interchangecheck> 0 </interchangecheck>
<Querymediastatus> 0 </querymediastatus>
<Rangecheck> 0 </rangecheck>
<Recordcoercions> 0 </recordcoercions>
<Simulate> 0 </simulate>
</Ividriversession>
</Driversessions>
<Logicalnames>
<Ivilogicalname id = "p187">
<Name> awg7122c </Name>
<Description> logic name for arbitrary waveform generators </description>
<Ividriversession idref = "p183"/>
</Ivilogicalname>
</Logicalnames>
After a try, I finally got through. So record it and make a summary.