Documentation Center

  • Trial Software
  • Product Updates

islogging

Determine whether analog input object is logging data

Syntax

bool = islogging(obj)

    Note:   You cannot use the legacy interface on 64–bit MATLAB®. See Session-Based Interface to acquire and generate data.

Description

bool = islogging(obj) returns true if the analog input object obj is logging data, otherwise false. An analog input object is logging if the value of its Logging property is set to On.

If obj is an array of analog input objects, bool is a logical array where each element in bool represents the corresponding element in obj. If an object in obj is logging data, islogging sets the corresponding element in bool to true, otherwise false. If any of the analog input objects in obj is invalid, islogging returns an error.

Examples

Create an analog input object and add a channel.

ai = analoginput('winsound');
addchannel(ai, 1)

To put the analog input object in a logging state, start acquiring data. The example acquires 10 seconds of data to increase the amount of time that the object remains in the logging state.

set(ai,'SamplesPerTrigger', 10*get(ai,'SampleRate'))
start(ai)

When the call to the start function returns, and the object is still acquiring data, use islogging to check the state of the object.

bool = islogging(ai)
bool =
   1

Create a second analog input object.

ai2 = analoginput('winsound');

Start one of the analog input objects again, such as ai, and use islogging to determine which of the two objects is logging.

start(ai)
bool = islogging([ai ai2])
bool =
     1     0

See Also

| | | | |

Was this topic helpful?