Instrument Control Toolbox    
instrcreate

Graphical tool for creating and configuring an instrument object

Syntax

Arguments

obj
An instrument object.

Description

instrcreate launches the Instrument Control Configuration Tool. Using this tool, you can create and configure an instrument object. You can then save the instrument object to the MATLAB workspace, convert it to the equivalent M-code, or save it to a MAT-file. Using this syntax, you have access to the MATLAB command line.

After the object is created, you can use it from the command line, or use it in conjunction with the Instrument Control ASCII Communication Tool, instrcomm. instrcreate is automatically launched if you call instrcomm without an input argument.

obj = instrcreate saves the configured instrument object to obj if the The MATLAB workspace check box is selected (see example below). Otherwise, obj is empty. Using this syntax, you do not have access to the MATLAB command line until you save the instrument object to the workspace, convert it to the equivalent M-Code, save it to a MAT-file, or select the Close button.

Example

This example uses instrcreate to create a GPIB object that will communicate with a Tektronix TDS 210 oscilloscope. The configuration steps are taken from Example: Reading Binary Data.

The first step is to launch the Instrument Control Configuration Tool:

The initial instrcreate window is shown below. Select The GPIB radio button to configure and create a GPIB object.

Select the Next button to display the property configuration window. This window consists of two parts, which are accessible with the GPIB and General tabs. Each tabbed window contains dialog box parameters that are directly associated with instrument object properties. By selecting the GPIB tab, you can select an adaptor, configure the communication address, and configure the conditions under which a read or write operation completes.

For this example, the GPIB object is created for a National Instruments GPIB controller with board index 0, and an oscilloscope with primary address 1.

The GPIB property configuration window is shown below.

Select the General tab to display the parameters associated with recording, buffering, the timeout, and callbacks. For this example, the GPIB object is configured in this way:

The General property configuration window is shown below.

Select the Next button to display the object creation window. This window allows you to save the GPIB object to the MATLAB workspace, convert it to the equivalent M-code, and save it to a MAT-file. For this example, the GPIB object is saved to the workspace using the variable g, and saved as M-code to the file myGPIB1.m.

The instrument object and M-file are created when you select the Create button. Note that you can select the Back button and modify parameters for g, or create a new instrument object.

The object creation window is shown below.

After the GPIB object is configured and created, you can use it to communicate with your instrument via the command line or via the Instrument Control ASCII Communication Tool, instrcomm. Note that instrcomm does not support asynchronous read and write operations. Therefore, the bytes-available events will not be generated.

See Also

Functions

instrcomm


  instrcomm instrfind