|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
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.
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)
obj = icdevice('tektronix_tds210_ex.mdd',g)
out = invoke(obj, 'drivertest')
disconnect(obj) delete ([g obj])