|On this page…|
You use a set property test step to verify a driver's set code or set command for a property. You provide a name for the step, select the driver property to test and the values to test it with, and define the conditions for the step's passing.
You provide a name for each test step. The name appears in the Test Explorer tree as well as in the results output.
Property to Test
A set property step can test only one property. You choose the property from the Property to Test list. Additional properties can be tested with additional steps, or with a sweep step.
Object(s) to Test
A property may be defined for the instrument or for a group object. If you are testing a group object property, you select which object you want tested in the Object(s) to Test list.
Define the Values to Test
If the property is has enumerated values, you can select one of the defined values, all of the supported values, or some other value. If the property's value is a double-precision number, you can select a value within its defined range, all supported values, or some other value. For a double, you set the number of values tested for all supported values in the Preferences dialog box (see Number of Values to Test).
Select When this Step Passes
The step passes when one or both of two conditions are met:
If you select more than one of these conditions, then both conditions must be met for the step to pass. If no boxes are selected, the test will pass.
Select If no MATLAB software or instrument error occurs.
Select If current value matches configured value.
You can run an individual test step to verify its behavior:
You may want to repeat this step as you observe the oscilloscope display. The test sets the display contrast to five different values: lowest acceptable value (1%), highest acceptable value (100%), and three approximately equally spaced integer values between these limits.
The tool automatically displays the Output Window with the test results.
This test step passed because, for each of the five display contrast settings, the tool read back a value that was equal to the configured value.
You use a get property test step to verify a driver's ability to read a property. You provide a name for the step, select the driver property to test, and define the conditions for the step's passing.
The settings for the get property step are the same as for a Test Step: Set Property, except that instead of providing a value to write, you can provide an output argument variable.
Output Argument. The test step assigns the optional output argument variable the value that results from reading the property. The variable is available for Exporting Results, after the test step has executed.
Unselect the box for If no MATLAB software or instrument error occurs.
Select If property value is, and enter a value of 80.
This value is chosen to generate a failure. If this step follows the previous step in the example, the display contrast is still set at 100. If this step is run by itself, the display contrast is set to 50 by the *RST command that is executed as part of your connect code for the driver.
You run the individual test step to verify its behavior.
A properties sweep step allows you to test several properties in a single step. All selected properties are tested for all supported values. (In the case of properties with double-precision values, you determine the Number of Values to Test, in the Test Preferences dialog box.)
The fields for name and passing conditions are the same as other types of test steps. The sweep step also requires that you select which properties and groups to test.
Select the Properties to Test. You may select any or all of the properties for testing in a sweep step. You may find it convenient to create several sweep steps for testing related groups properties together.
Select the Group Object to Use on Sweep. For those properties defined for group objects, you can select a particular group object to test, or all the group objects. You can also define different sweep steps for different group objects.
For the Measurement group, select All Measurement group objects.
For the Trigger group, select All Trigger group objects.
Select If no MATLAB software or instrument error occurs, and
Select If current value matches configured value
You run the sweep test step to verify its behavior.
The Output Window is updated as each property in the sweep is tested. Note that the entire sweep is only one step in the overall test.
A function test step sends a function call to the instrument. You select the function called, the input data and output arguments (if required), and the conditions for passing.
You provide output argument variable for any data returned from the function. The output arguments can be used to determine if the test step passes, or for Exporting Results after the test step has executed.
If no instrument or MATLAB software error occurs as a result of attempting to execute the function
If the returned output arguments match expected values
If the output of a specified function is true
If you select more than one of these conditions, then all selected conditions must be met for the step to pass. If no boxes are selected, the test will pass.
Select If no MATLAB software or instrument error occurs.
Select If output arguments are, and enter in its field 'CH1', 1, 2500.
Unselect If output of function ... is true.
Note that you set the input argument for the stop address to 3000, but you set the expected value for its output argument, StopAdr, to 2500. This is because the maximum address of the oscilloscope is 2500. If you attempt to exceed that value, the oscilloscope address is set to the maximum.
You can run an individual test step to verify its behavior