Main Content

islogging

Determine if video input object is acquiring data

Description

tf = islogging(obj) returns logical 1 (true) if the video input object obj is acquiring data and logical 0 (false) otherwise. A video input object is acquiring data if the value of its Logging property is 'on'.

example

Examples

collapse all

Create a video input object that connects to hardware such as a Windows web cam.

obj1 = videoinput("winvideo",1,"MJPG_1280x720");

Start acquiring data. This example acquires 500 frames to increase the amount of time that the object remains in logging state.

obj1.FramesPerTrigger = 500;
start(obj1)

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

tf = islogging(obj1)
tf =

  logical

   1

Stop the acquisition and check the logging status again.

stop(obj1)
tf = islogging(obj1)
tf =

  logical

   0

Now, create another connection.

obj2 = videoinput("winvideo");

Start the first object again and use islogging to determine which of the two objects is acquiring data.

start(obj1)
tf = isrunning([obj1 obj2])
tf =

  1×2 logical array

   1   0

Input Arguments

collapse all

Video input object to query, specified as a video input object created using videoinput.

Output Arguments

collapse all

Whether obj is acquiring data, returned as numeric or logical 1 (true) or 0 (false).

If obj is an array of video input objects, tf is an array where each element indicates whether the corresponding element in obj is acquiring data.

Version History

Introduced before R2006a