Data Acquisition Toolbox
  Function/Property:
    Search    Help Desk 
delete    Examples   See Also

Delete device objects, channels, or lines.

Syntax

delete(obj)

delete(obj.Channel(index))

delete(obj.Line(index))

Description

delete removes device objects, channels, or lines from the data acquisition engine and the MATLAB workspace. If multiple references to a device object exist in the workspace, removing one reference invalidates the remaining references. These remaining references should be cleared from the workspace. delete should be used at the end of a data acquisition session. If delete is issued and the Running property is set to On, the device object, channels, or lines will not be deleted and an error will be returned.

delete(obj) removes the device object including all associated channels or lines. If obj is the last object accessing the driver, then the driver and associated adaptor are closed and unloaded.

delete(obj.Channel(index)) removes the channels specified by index from obj. As a result, the remaining channels may be reordered.

delete(obj.Line(index)) removes the lines specified by index and from obj. As a result, the remaining lines may be reordered.

Examples

Sound Cards

Suppose you create the analog input object AI1 for a sound card, and configure it to operate in stereo mode.

You can now configure the sound card for mono mode by deleting hardware channel 2.

If hardware channel 1 is deleted instead, then an error is returned.

National Instruments

Suppose you create the analog input object ai for a National Instruments board, add hardware channels 0-7 to it, and make a copy of channels 0 and 1.

To delete channels 0 and 1

These channels are deleted from the data acquisition engine and the workspace, and are no longer accessible associated with ai. The remaining channels are reindexed such that the indices begin at 1 and increase monotonically to 14.

To delete the analog input object

See Also

Functions

clear, daqreset



[ Previous | Help Desk | Next ]