Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

2 Period measurements with sychronized Timers

Hello

 

I am trying to measure the periodic time of 2 signals. The goal is, to start the 2 measurements sychronized. I use the NI USB 6216 with LV Version 7.1.

 

To achieve the sync start both Counters (each in "Low Frequency with 1 Counter"-Mode) are triggered on a digital edge. As a source i am using the ai/StartTrigger (ghost ai-measurement).

That works sometimes, but sometimes one of the timers stops with an timeout error (Error -200284 occurred at DAQmx Read (Counter 1D DBL 1Chan NSamp).vi).

Any ideas why the vi works sometimes and sometimes breaks?

 

synced timers.jpg

0 Kudos
Message 1 of 13
(4,120 Views)

It looks like you've got most of it set up right, but I would suggest you trigger off 'AI/SampleClock' rather than 'AI/StartTrigger'.  Your AI task isn't configured to use a start trigger, so I'm a little surprised it works even

some of the time.  The AI sample clock won't start until you start the AI task, and since you correctly

sequenced the counter tasks to start first, they should start in sync.

 

-Kevin P

ALERT! LabVIEW's subscription-only policy came to an end (finally!). Unfortunately, pricing favors the captured and committed over new adopters -- so tread carefully.
0 Kudos
Message 2 of 13
(4,107 Views)

Thank you for the hint.

I just gave it a try, but the result is the same. The vi runs through 1, 2 or even 3 times (manually restarted) and then it goes into the timout error.

0 Kudos
Message 3 of 13
(4,105 Views)

Hi, I think you could start off this example which should work.

 

http://forums.ni.com/ni/board/message?board.id=250&message.id=55698  

 

 

 

regards 

 

M. Brauner NIG 

0 Kudos
Message 4 of 13
(4,088 Views)

Good idea;-)

Your link links to the beginning of this thread.

0 Kudos
Message 5 of 13
(4,083 Views)

Ok, you´re right. My fault.

Please try the attached vi. It will measure two counter channels` period triggered off of a shared PFI and meets your 

requirement "The goal is, to start the 2 measurements sychronized".

You can do the same buffered. 

 

regards

 

M. Brauner NIG 

 

0 Kudos
Message 6 of 13
(4,079 Views)
Thanks for your help. Could you please save the vi in LV7.1 (sorry, but thats the current LV Version of the company)
0 Kudos
Message 7 of 13
(4,075 Views)

A couple more troubleshooting thoughts:

 

1. Maybe the timeout, um, represents a valid timeout because 5 seconds isn't long enough to collect 'Samples to Read' periods?  Ok, this probably isn't it, but I'd hate to overlook the obvious...

 

2.  Try making the timeouts very much longer on the calls to DAQmx Read for the counter tasks.  If that helps, the problem may be that the 3 tasks are only sequenced after starting the counter tasks.  If one counter task quickly reaches call to DAQmx Start.vi and then the other tasks' config calls take a (surprisingly) long time, some of the timeout period is being wasted waiting for the other tasks to be configured.

   The long timeout may be a suitable solution for you.  Another possibility is to set up some dataflow-based sequencing (probably via error cluster) that gets all 3 tasks fully configured, and only after that would you start the 2 counter tasks and then the AI task.

 

-Kevin P

  

ALERT! LabVIEW's subscription-only policy came to an end (finally!). Unfortunately, pricing favors the captured and committed over new adopters -- so tread carefully.
0 Kudos
Message 8 of 13
(4,070 Views)
I have already tried "huge" timeouts (like 60 seconds...). No influence on the error. For the tests I am using a frequency generator, usually set to 100µs periodic time ( i also tried different periodic times in the range of 10µs to 1ms -> no influence on the error occurence).
0 Kudos
Message 9 of 13
(4,067 Views)

Here is the example VI for LV 7.1

 

 

 

regards 

 

M. Brauner NIG 

0 Kudos
Message 10 of 13
(4,044 Views)