|On this page…|
You can specify a test file to load when you start midtest, open a test file after the MATLAB® Instrument Driver Testing Tool is already up, or create a new test. You may find it convenient to keep the driver and test file together in the same directory. For easy use in the MATLAB Command Window, you can put that directory in the MATLAB path with the addpath command.
The Name field allows a one-line text definition for your test. This name appears in the header of the test results in the Output Window.
The Description field allows a full definition of the text with as much descriptive text as you need.
In the Driver text field, you specify the driver to be tested. This is any MATLAB instrument driver, usually with the .mdd extension. Enter the full path to the driver, or click Browse to navigate to the driver's directory.
You specify the interface with the instrument for the testing of the driver. The instrument object type may be GPIB, VISA, TCPIP, UDP, or serial port. Depending on the type you choose, the New Object Creation dialog box prompts you for further configuration information.
The tool then creates a device object based on interface and driver.
The Test Preferences dialog box allows you to set certain behaviors of the tool when running a test.
This specifies whether the test runs all the steps or only one step in the test.
This specifies what happens if a step within the test fails. The test may stop after the failed step or continue, with or without resetting the instrument.
This field specifies the expected string returned from the instrument when there is no error. If you indicate that a step passes when no error is returned from the instrument, the tool compares the string returned from the instrument via the geterror function, to the string given here in the Preferences dialog box. If the strings match, then the tool assumes there is no error from the instrument.
A double-precision property can be tested using all supported values. You can request this when testing it as a single step, or the tool does it automatically when the property is tested as part of a property sweep step. This field specifies how many values are tested for such a property.
The number of values includes the defined minimum and maximum for the property, and integer values equally spaced between these limits.
If your property requires noninteger values for testing, then create a separate test step for that property instead of including it in a sweep.
This example identifies the driver to be tested, and defines global setup information for the test. You will be testing the driver created in the examples of MATLAB Instrument Driver Editor Overview.
In the Driver field, enter the name of the driver you created in MATLAB Instrument Driver Editor Overview. The text field will display the whole pathname, with the driver file tektronix_tds210_ex.mdd.
Select your Instrument object type, Vendor, Board index, and Primary address of your instrument.
The example illustrations in this chapter use a CEC GPIB board with index 0 and the instrument at address 4. Your configuration may be different.
For Select run mode, click Run all steps.
For Select fail action, click Continue test.
For Message returned from instrument when no error occurred, enter "". (This is an empty string in double quotes.)
For Number of values to test for double properties, enter 5.
The MATLAB Instrument Driver Testing Tool now displays all your setup information.