Example 1—Creating IVI Driver Files with the Instrument Driver Development Wizard

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.

  1. In LabWindows/CVI, select Tools»IVI Development»Create IVI Specific Driver to launch the wizard.

    Note Note  At any time, you can click Back to return to a previous panel and change the information.
  2. Click Next on the Welcome panel to begin. The Select an Instrument Driver panel appears, as shown in the following figure.

  3. Enter the following information in the wizard panel:

    1. Enable the Create New Driver option.
    2. Select GPIB in the I/O Interface list box.
    3. Select Digital Multimeter in the Type of Instrument list box.
  4. Click Next to continue to the General Information panel. Enter the following general instrument driver information:

    1. Enter Fluke 45 Digital Multimeter in the Instrument Name control.
    2. Enter FL45 in the Instrument Prefix control.
    3. Enter your name, company, phone number, and fax number in the Developer Information section.
    4. Click Browse to select a target directory for the new instrument driver.
  5. 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.
    1. Delete the contents of the Default Setup Command control.
    2. For the Fluke 45 and all other single-channel devices, enter 1 in the Channel List String control.
  6. 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.

  7. 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.
    1. Leave *IDN? in the ID Query Command control. This setting is the default.
    2. Enter FLUKE, 45 in the Expected ID Query Response control.
    Ensure that your panel looks as shown in the following figure:

  8. 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.
  9. Click Next to continue to the Self-Test panel.

    1. 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.
    2. Select Self-Test Code from the Self-Test Response Contents ring control.
    3. 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.
    Ensure that your panel looks as shown in the following figure:

  10. Click Next to continue to the Revision panel.

    1. 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.
    2. 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.
  11. 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:

    1. Select all supported operations to test.
    2. Select the resource descriptor of the instrument in the Resource Descriptor control.
    3. Enter 0 in the Reset Delay (s) control.
    4. The Fluke 45 takes 15 seconds to perform the self-test operation. Enter 15 in the Self-Test Delay (s) control.
    5. Click Run Tests.
    The Test Results panel displays the operations the test performs and the results of these operations.
  12. 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.
  13. 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.
  14. Enable Launch Attribute Editor and click Close to launch the Attribute Editor.

WAS THIS ARTICLE HELPFUL?

Not Helpful