stop

Stop device object

Syntax

stop(obj)

Arguments

obj

A device object or an array of device objects.

Description

stop(obj) terminates the execution of the device object obj.

More About

expand all

Tips

An analog input object automatically stops when the requested samples are acquired or data is missed. An analog output object automatically stops when the queued data is output. These two device objects can also stop executing under one of these conditions:

  • The Timeout property value is reached.

  • A run-time error occurs.

For analog input objects, stop must be used when the TriggerRepeat property or SamplesPerTrigger property is set to inf. For analog output objects, stop must be used when the RepeatOutput property is set to inf. When stop is issued for either of these device objects,

  • The Running property is set to Off.

  • The Logging property or Sending property is set to Off.

  • The callback function specified for StopFcn is executed.

  • The stop event is recorded in the EventLog property.

  • All pending callbacks for this object are discarded.

For any device object, you can specify stop as the value for a callback property.

ao.TimerFcn = @stop;

    Note   Issuing stop is the only way to stop an executing digital I/O object. You typically execute a digital I/O object to periodically update and display its state. Refer to the diopanel example.

Was this topic helpful?