1

(Sorry I was not able to post picture as my reputation level is below 10)

What I wanted to do is, I want my laser displacement daq to start acquiring data after one second after the another daq acquisition starts acquiring data.

I am not able to add delay on the laser displacement daq. (Both method should run for 10 second and laser displacement daq should be 1 second late at acquiring data.)

Thanks

Biswas
  • 13
  • 1
  • 3

2 Answers2

2

There are different ways to do that. Here are two ideas:

  1. Acquire 11 seconds of data for both, and throw away the first 1 second of data from the laser.

  2. Use the Time Delay Express VI and wires to control the order of code execution, as suggested by @nekomatic: enter image description here (Note: My original code, which uses Sequence Structures and the Wait (ms) Function, is at https://i.stack.imgur.com/9pIwb.png)

JKSH
  • 2,658
  • 15
  • 33
  • 1
    If you instead use the `Time Delay` Express VI, you don't need a sequence structure, because you can wire the error out from the DAQmx Timing vi to the error in of Time Delay, and the error out from Time Delay to error in of DAQmx Start Task. Using the error wire to control the order of execution like this is standard practice and good style in LabVIEW. http://zone.ni.com/reference/en-XX/help/371361J-01/lvexpress/time_delay/ – nekomatic Apr 26 '16 at 13:47
  • In my opinion correct timing is not guaranteed by your block diagram. The lower part of the code and the upper one are independent from each other. Strictly speaking the lower part (the one with the delay) could be executed until the "Task stop" VI even before the upper one starts the task. – MarcoM Apr 26 '16 at 15:59
  • Technically this is true, although unlikely on any modern PC. If you want to guarantee synchronisation (to +/- 1 sample), take JKSH's first suggestion and acquire from both channels in one operation and ignore the data you don't need. – nekomatic Apr 26 '16 at 19:54
  • 1
    Thanks for your input, nekomatic and MisterEmme. I've updated my code to use Time Delay and stricter sequencing using the error wires. – JKSH Apr 27 '16 at 08:53
2

You can consider using DAQmx Trigger Start Delay Property Node.

Here you can find a full example.

And here a nice tutorial from National Instruments on Task synchronization.

MarcoM
  • 1,093
  • 9
  • 25