Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

Synchronizing counter and analog tasks

Solved!
Go to solution

Hi,

 

I would like to synchronize an analog task and a counter task. I want to share the AI sample clock for the analog task and the counter task. I found an example on NI website that seem be be suitable:

http://digital.ni.com/public.nsf/allkb/BB7AE2D12BB04CBE862574FA005D3826

 

I'm trying to use the first example given in the KB: CounterSynch-Analogtask.vi. I'm using a PCI 6621 with LV 8.6 and DAQmx 8.7.2.

I'm getting an error when running this example (see attachment).

I also tried to insert a DAQmx read property node(available samples per channel) inside the while loop reading the data and connect to one of the counter task This one always displays a 0 value. If I simulate the 6621, the property node value is increasing at the beginning and then decreases to reach 0 and I finally get the same error that I got with the card.

 

If you have an idea on what could be the root of problem.

 

Thanks in advance.

 

Best regards.

 

Clément GIROD

DAM

0 Kudos
Message 1 of 3
(4,255 Views)
Solution
Accepted by topic author CGIDAM

Hi Clemente,

 

The reason you were getting this error is because the counter task was set to finite while it is continuously reading in the while loop.

The VIs on the same link have been editted so that they will work. Please chech them out and see if they work.

 Please let me know if you have any further questions.

 

Best Regards,

Faris A

Bueller
0 Kudos
Message 2 of 3
(4,233 Views)

Hi Faris,

 

Thanks for your answer, it was so obvious so I did see it.

 

Have a great day.

 

Regards

0 Kudos
Message 3 of 3
(4,223 Views)