Data Acquisition Toolbox    

Starting Multiple Device Objects

With the Data Acquisition Toolbox, you can start multiple device objects. You might find this feature useful when simultaneously using your hardware's analog output (AO) and analog input (AI) subsystems. For example, suppose you create the analog input object ai and the analog output object ao for a sound card, and add one channel to each device object.

You should use manual triggers when starting multiple device objects because this trigger type executes faster than other trigger types with the exception of hardware triggers. Additionally, to synchronize the input and output of data, you should configure the ManualTriggerHwOn property to Trigger for ai.

Configure ai for continuous acquisition, call the callback function qmoredata whenever 1000 samples are output, and call daqcallback when ai and ao stop running.

As shown below, the callback function qmoredata extracts data from the engine and then queues it for output.

Queue data in the engine, start the device objects, and execute the manual triggers.

You can determine the starting time for each device object with the InitialTriggerTime property. The difference, in seconds, between the starting times for ai and ao is

Note that this number depends on the specific platform you are using. To stop both device objects:

The output from daqcallback is shown below.


  Example: Performing a Linear Conversion Digital Input/Output