Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

buffered position measurement with position trigger

Hello everyone,
 
ich have a PCI-6601 counter/timer device and I'm progamming with LabVIEW 8.5.1 and DAQmx 8.7.1 on Win XP.
I want to perform 2 linear position measurements to compare both positions. I started with "Meas Angular Position-Buffered-Cont-Ext Clk-Arm Start Trig.vi" from Example Finder. In the example I found a note:
"[...] Set the Sample Clock Source. Note: An external sample clock must be used. Counters do not have an internal sample clock available. You can use the Gen Dig Pulse Train-Continuous example to generate a pulse train on another counter and connect it to the Sample Clock Source you are using in this example."
So, I used a 3rd counter to generate a sample clock at 1kHz frequency. All works fine.
 
Now my question:
Is it possible to use one of the position counters as a sample clock for the other position counter (for example using the "ctr0 out" as sample clock for both counters)?
In the moment, there is 1msec between two samples for both counters. The measurement is based on time.
I want to have for every e.g. 10th tick of counter1 the value of counter2. This measurement would be based on position.
 
I hope I explained my issue enough and someone can give a hint.
 
Uli
 
0 Kudos
Message 1 of 4
(4,183 Views)
Hello Uli,

I think you will need one more counter if you want to read both position counters with different source timings. Sorry, but I see no other possibility.

Regards
Rüdiger
0 Kudos
Message 2 of 4
(4,126 Views)

I think there *are* some possibilities, but you may need to change the approach just a bit.  A few thoughts and comments:

1. It isn't clear whether you've properly sync'ed your 2 position measurements.  Note that each task starts tracking position when you make the software call to DAQmx Start.  The tasks will each buffer their position values on sample clock edges after you start the sample clock.  So you need to be sure that both position measurement are started before you start the sample clock task.  That'll ensure that if you read = quantities of samples from each task, they will also correlate in time.  Note that the initial position value may be somewhat meaningless, depending on whether things are already in motion when you start your app.

2. While it's also possible to create a separate sample clock for each position measurement task, and to get them sync'ed with one clock derived as an integer divisor of the other, I wouldn't necessarily recommend it.  It's probably much simpler to sample both positions at the higher rate, and then down-sample in software after the fact.  You might find a Decimate function on the block diagram palette.

-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.
Message 3 of 4
(4,123 Views)
Hello Kevin,
 
thank you for your answer.

[...] Note that each task starts tracking position when you make the software call to DAQmx Start.  The tasks will each buffer their position values on sample clock edges after you start the sample clock.  So you need to be sure that both position measurement are started before you start the sample clock task.  That'll ensure that if you read = quantities of samples from each task, they will also correlate in time. 
Note that the initial position value may be somewhat meaningless, depending on whether things are already in motion when you start your app. [...]

These are two very interesting notes. Actually I started the sample clock before the position measurement and I didn't have a closer look at the initial position.
I've changed these things already.
 
Meanwhile I can use a M-Series device (6220 or 6251) instead of a 6601. I wondered if I can use change detection on a digital line to trigger both position measurements.
 
Today I found a post from you in Multifunctio DAQ forum, in which you describe exactly this kind of measurement.
Kevin, thank you for answering my question before I asked. Now I'm sure this will work.
 
Uli
0 Kudos
Message 4 of 4
(4,072 Views)