LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Start a task exactly after a defined time

Hello everybody,

 

can someone help me by my problem. I have an analog output task that I start first. Now I would like to start excatly after 100 ms a digital output task. Following the code:

DAQmxErrChk(DAQmxStartTask (AnalogOut));

Delay (0.1);
DAQmxErrChk(DAQmxStartTask (DigitalOut));

 

 

At the moment I have the problem, that my digital task starts not exactly after the 100 ms. It starts by something like 102 ms. Is there a way in LabWindows to start a task exactly after a definded time? I think my problem is the system time of my computer from reading the command DQAMxStartTask and the actual start of the generation.

 

Hope someone can help me.

 

Best regards

0 Kudos
Message 1 of 2
(2,436 Views)

Ideally you could use a board internal counter to generate the necessary signal. The principle could be to count the AO sample clock and fire the counter output after a proper count. If you only need a signal, the counter output itself could supply it, otherwise it could be the start trigger for the digital task. This mechanism relies on having an available counter onboard, i.e. not already used for AO or DO generation or other tasks.



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 2 of 2
(2,403 Views)