Example 1 - Creating IVI Driver Files with the Instrument Driver Development Wizard
- Updated2023-02-21
- 5 minute(s) read
The Instrument Driver Development Wizard creates driver files. Through a series of panels, the wizard prompts you for the type of driver you want to create, general instrument information, the common operations the driver supports, and the commands and expected responses the instrument uses for common driver operations.
Complete the following steps to use the Instrument Driver Development Wizard to create the driver files.
- In LabWindows/CVI, select Tools»IVI Development»Create IVI Specific Driver to launch the wizard.
Note At any time, you can click Back to return to a previous panel and change the information. - Click Next on the Welcome panel to begin. The Select an Instrument Driver panel appears, as shown in the following figure.
- Enter the following information in the wizard panel:
- Enable the Create New Driver option.
- Select GPIB in the I/O Interface list box.
- Select Digital Multimeter in the Type of Instrument list box.
- Click Next to continue to the General Information panel. Enter the following general instrument driver information:
- Enter Fluke 45 Digital Multimeter in the Instrument Name control.
- Enter FL45 in the Instrument Prefix control.
- Enter your name, company, phone number, and fax number in the Developer Information section.
- Click Browse to select a target directory for the new instrument driver.
- Click Next to continue to the General Command Strings panel.
As part of the initialization operation, instrument drivers typically set the instrument to a default state. The default state configures the instrument so that instrument driver functions operate correctly. Specify the default setup command string in the Default Setup Command control. The Fluke 45 does not require the instrument driver to send a default setup command string.
IVI drivers use channel strings to identify the channels of an instrument. Enter the channel strings you want to use for the instrument in the Channel List String control. Use commas to separate multiple channel strings. For a multichannel instrument, you typically use channel strings such as 1, 2, 3, 4; A1 through A4; or D0 through D15. If the instrument has a front panel, you might want to use the channel names from the front panel.- Delete the contents of the Default Setup Command control.
- For the Fluke 45 and all other single-channel devices, enter 1 in the Channel List String control.
- Click Next to continue to the Standard Operations panel. Use this panel to select which standard operations the instrument supports.
The Fluke 45 supports the identification query, reset, self-test, and firmware revision query operations, but it does not support an error query operation. Deselect Error Query in the Standard Operations panel and ensure that your panel looks as shown in the following figure.
- Click Next to continue to the ID Query panel, which contains options for the commands and response formats that the instrument uses to implement the operations you select.
The *IDN? command instructs the Fluke 45 to return its identification string. The driver uses the first portion of this string to determine if it is talking to the correct type of instrument.- Leave *IDN? in the ID Query Command control. This setting is the default.
- Enter FLUKE, 45 in the Expected ID Query Response control.
- Click Next to continue to the Reset panel. The *RST command resets the Fluke 45. Leave *RST in the Reset Command control. This setting is the default.
- Click Next to continue to the Self-Test panel.
- Leave *TST? in the Self-Test Command control. This setting is the default.
The *TST? command instructs the Fluke 45 to perform its internal self-test and return the result. The Fluke 45 returns the self-test result as a code. - Select Self-Test Code from the Self-Test Response Contents ring control.
- Select %hd from the Format Choices ring control.
The Format String indicator displays the format string that VISA uses to interpret the instrument response. The %hd format string is the VISA format specifier for a 16-bit integer.
- Leave *TST? in the Self-Test Command control. This setting is the default.
- Click Next to continue to the Revision panel.
- Leave *IDN? in the Revision Command control. This setting is the default.
The response to the *IDN? command also includes the revision of the Fluke 45 instrument. - Leave %s,%s,%s,revision\n(SCPI format) from the Format Choices ring control. This setting is the default.
The Format String indicator displays the format string that VISA uses to interpret the instrument response. This format string instructs VISA to ignore everything in the response up to the third comma and then to read the remainder of the response until it encounters a linefeed.
- Leave *IDN? in the Revision Command control. This setting is the default.
- Click Next to continue to the Test panel.
If you have a Fluke 45 instrument available and can connect it to the computer, the wizard tests the commands you entered in the previous panels by sending the commands to the instrument and displaying the responses.
Run the test as follows:
- Select all supported operations to test.
- Select the resource descriptor of the instrument in the Resource Descriptor control.
- Enter 0 in the Reset Delay (s) control.
- The Fluke 45 takes 15 seconds to perform the self-test operation. Enter 15 in the Self-Test Delay (s) control.
- Click Run Tests.
- Click Done to return to the previous panel.
If any of the operations generate errors or the responses are not as you expect, you can click Back to return to the corresponding panel and change the information. You can then click Next to return to the Test panel to verify the new information. - When you are satisfied with the test results, click Generate. The wizard generates the instrument driver files using the information you provide.
The driver files are the fl45.c, fl45.h, fl45.fp, and fl45.sub files. The resulting driver implements all the functions that IVI and VXIplug&play require. These functions are completely operational. Refer to the LabWindows/CVI Help for a complete list of the functions that IVI and VXIplug&play require. In addition, the driver has all the functions and attributes that are common to DMMs. These functions and attributes have example code with instructions on how to modify the code for a specific DMM. - Enable Launch Attribute Editor and click Close to launch the Attribute Editor.