| Contents | Index |
| On this page… |
|---|
In the preceding examples of this chapter, you have been saving the test file after creating each step. The test file is saved in XML format. Here are some other save options.
You save the test file as MATLAB code by clicking the File menu and selecting Save Test as M-Code.
You can execute the test by calling this file from the MATLAB Command Window.
For example, you can save the test file you created in this chapter as tektronix_tds210_ex_test.m. Then you execute the test from the MATLAB Command Window by typing
tektronix_tds210_ex_test
The test results are displayed in the MATLAB Command Window.
You save your test as a driver function by clicking the File menu and selecting Save Test as Driver Function.

When you enter a name for the driver test function, the invoke command at the bottom of the dialog box reflects that name. You use that invoke command to execute the driver function from the MATLAB Command Window or in a file.
Click the File menu and select Save Test as Driver Function.
Enter drivertest in the Specify the driver function name field.
A function called drivertest is created and saved as part of the instrument driver file. You can open the driver file in the MATLAB Instrument Driver Editor tool (midedit) to verify that the drivertest function is included.
Now that the test function is included in the driver, you access it with the invoke command from MATLAB.
In the MATLAB Command Window,
g = gpib('cec',0,4)Create a device object, specifying the driver with the drivertest function saved in it.
obj = icdevice('tektronix_tds210_ex.mdd',g)connect(obj)
out = invoke(obj, 'drivertest')
When the test is complete, disconnect from the instrument and delete the objects.
disconnect(obj) delete ([g obj])
![]() | Defining Test Steps | Testing and Results | ![]() |

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.
| © 1984-2012- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |