|On this page…|
Device groups are used to group several related properties. For example, a channel group might contain the input channels of an oscilloscope, and the properties and methods specific to the input channels on the instrument.
MATLAB® instrument drivers specify the type and quantity of device groups for device objects.
Group objects can be accessed via the get command. For the Tektronix® TDS 210 oscilloscope, there is a channel group that contains two group objects. The device property to access a group is always the group name.
chans = get(d, 'Channel') HwIndex: HwName: Type: Name: 1 CH1 scope-channel Channel1 2 CH2 scope-channel Channel2
To display the functions that a device group object supports, use the methods function.
You can also display a list of the group object's properties and their current settings with the get function.
To get help on a driver-specific property or function, use the instrhelp function, with the name of the function or property.
This example shows how to obtain waveform data from a Tektronix TDS 210 oscilloscope with a square wave signal input on channel 1, on a Windows® machine. The methods used are specific to this instrument:
s = serial('com1'); d = icdevice('tektronix_tds210', s); connect(d);
w = get(d, 'waveform');
This group is specific for the hardware you are using. The TDS 210 oscilloscope has one Waveform; therefore the group contains one group object.
HwIndex: HwName: Type: Name: 1 Waveform1 scope-waveform Waveform1
Obtain the waveform — Now that you have access to the Waveform group objects, you can call the readwaveform function to acquire the data. For this example, channel 1 of the oscilloscope is reading the signal. To access this channel, call readwaveform on the first channel.
wave = invoke(w, 'readwaveform', 'channel1');
disconnect(d) delete([d s]) clear d, s, w, wave;