03-02-2010 03:05 AM
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?
03-02-2010 08:04 AM
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
03-02-2010 08:39 AM
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.
03-03-2010 07:26 AM
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
03-03-2010 07:39 AM
Good idea;-)
Your link links to the beginning of this thread.
03-03-2010 09:02 AM
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
03-03-2010 09:34 AM
03-03-2010 10:01 AM
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
03-03-2010 10:20 AM
03-04-2010 03:51 AM
Here is the example VI for LV 7.1
regards
M. Brauner NIG