Academic Company Events NI Developer Zone Support Solutions Products & Services Contact NI MyNI
1 ratings:
 4 out of 5     Rate this Document

Synchronizing DAQmx Devices in Measurement Studio With ai\StartTrigger Requires Slave Task To Be Explicitly Started First

Primary Software: Driver Software>>NI-DAQmx
Primary Software Version: 7.4
Primary Software Fixed Version: N/A
Secondary Software: Measurement Studio

Problem:
Sometimes when synchronizing two DAQmx devices by configuring a start trigger on one device to be the ai\StartTrigger line on the other device, the slave device misses the start pulse. How can I guarantee that the synchronization will work properly?

Solution:
You can synchronize two DAQmx devices by configuring the start trigger on one task/device (the slave) to the ai\StartTrigger of the other task/device. But in order for the slave task to receive the start trigger pulse sent by the master task, it must be started before the master; otherwise the start trigger will be missed. This causes non-obvious behavior when a user doesn't explicitly start the tasks, and calls the MStudio API functions BeginRead* to begin an asynchronous read operation. Even if the BeginRead* function is called on the slave task first, the slave task is not guaranteed to be implicitly started first. This is because the call to BeginRead* function starts a new thread to retrieve the data asynchronously, and because of this there is a race condition between the slave and master tasks as to which one will be started first--the operating system can schedule threads in any order. Thus you must explicitly call the Start method on the slave task and then call it on the master task before starting any asynchronous read operations.

Related Links:

Attachments:





Report Date: 08/31/2004
Last Updated: 02/24/2009
Document ID: 3CU9BFUP

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
  1 2 3 4 5
Please Contact NI for all product and support inquiries.submit