Invoking Device and Group Object Functions

Contents

Identifying Object Functions

Use the METHODS function to identify device and group object functions. In this example a device object is created using the Tektronix TDS210 MATLAB instrument driver shipped with the toolbox.

>> g = gpib('mcc', 0, 2);
>> d = icdevice('tektronix_tds210.mdd', g);
>> methods(d)
Methods for class icdevice:
Contents       disp           icdevice       instrument     methods        selftest
cholinc        display        igetfield      invoke         ne             set
class          end            inspect        isa            obj2mfile      size
close          eq             instrcallback  isequal        open           struct2cell
connect        error          instrfind      isetfield      openvar        subsasgn
ctranspose     fieldnames     instrfindall   isvalid        permute        subsref
delete         get            instrhelp      length         propinfo       transpose
devicereset    geterror       instrhwinfo    linsolve       reshape        vertcat
disconnect     horzcat        instrnotify    luinc          rethrow        warning
Driver specific methods for class icdevice:
autoset        drivertest     factoryreset

The functions in the first set are common to all device objects, and in some cases, common to all MATLAB objects. The functions in the second set are specific to the particular driver used in constructing the device object.

Invoking Common Functions

Functions that are common to all device objects are invoked directly with the object. For example, to invoke a device reset:

>> devicereset(d);

Invoking Driver-Specific Functions

Functions that are specific to the driver must be invoked using the INVOKE function. For example, to invoke the autoset function for the Tektronix TDS210 oscilloscope:

>>invoke(d, 'autoset');

The first argument to the invoke function is the device or group object. The second argument is the name of the driver-specific function as a string. Any additional arguments required by the function must be included as arguments after the function name.