With the Test & Measurement Tool you can scan for your driver, create a device object that uses that driver, set and get properties of the object, and execute functions.
This example illustrates how to use the generic driver you created in Writing a Generic Driver.
If your driver is not in the
in the MATLAB® Command Window, make sure that the directory containing
your driver is on the MATLAB path.
If you do not see the directory in the path listing, and the
driver is not in the
add the directory to the path with the command
directory is the
pathname to the directory containing your driver.
Open the Test & Measurement Tool.
In the Test & Measurement Tool tree,
Instrument Drivers node.
MATLAB Instrument Drivers node.
Your driver might not be listed yet, so
click Scan in the lower-right corner
of the tool. If the tool found your driver, it is listed in the tree
in the tree.
in the tree, and select Create Device Object
Using Driver. The following dialog box appears.
Select the Select the created device object in the tree on dialog close check box. The device object in this example does not need a resource, so keep that field empty.
When the Test & Measurement Tool creates the device object,
an entry for the object appears as a node in the tree. The
should already be selected in the tree. This refers to the device
object you just created.
Click Connect in the upper-right corner of the Test & Measurement Tool. This establishes a communication channel between the tool and the IE browser window, and an empty IE window appears on your screen. Remember that the Create code for your driver creates an object for the IE browser, and the Connect code and makes its window visible.
The driver you created allows you to specify where the browser window appears on your screen and how large it is.
Click the Properties tab,
and then select
Top in the Device object properties list.
The first value displayed for setting this property is
Click Set. The IE browser window shifts upward to the top edge of your screen.
With the mouse, grab the IE window, and drag it down some distance from the top of the screen.
Now return to the Test & Measurement
Tool window, and click Get for the
Notice in the Response pane how many pixels down
you have moved the window.
Use your driver
Vsize property to change
the size of the browser window.
Vsize in the Device object properties list.
Enter a property value of
and click Set. Notice the IE window size.
Enter a property value of
click Set. Notice the IE window size.
Try resizing the IE browser window directly
with the mouse. Then in the Test & Measurement Tool, click Get for
Vsize property. Notice the value returned
to the Response pane.
goTo function of your generic driver
to control the Web page that the browser displays.
In the Test & Measurement Tool, click the Functions tab for your device object.
the list of Device object functions.
In the Input argument(s) field,
'www.mathworks.com'. Be sure to include the
Click Execute. Observe the IE browser and see that it displays the MathWorks Web site.
Experiment freely. When you are finished,
Browser-ie_drv node in the tree
and select Delete Object. Close the
Test & Measurement Tool, and close the IE browser window you created
in this example.