09-22-2022 08:44 AM
I count ticks of two two counters (ctr0/ctr1) on PXI-6602 to produce a pulse train like shown below. The trigger comes from PXI-6602 DIO every 500 mSec.
Everything is working fine, but when I change the "Samples per channel = 2", I get an error:
The idea is to double the pulses like shown below:
If I exclude (comment out) the 2nd counter (ctr1), I get the desired double pulse train, but I need the 2nd counter as well:
Attached is my LabVIEW 2012 VI.
Any idea what is wrong.
09-22-2022 11:45 AM
Solution first, explanation second.
Solution: instead of using ctr0 and ctr1, use ctr0 and ctr2. More generally, use any other combo except using both of what it considers its pairs of adjacent counters, i.e. (0 & 1), (2 & 3), (4 & 5), or (6&7) when you need 2 or more multi-pulse finite pulse trains.
Explanation: the 660x counter/timer boards require the use of *both* counters in a pair to produce a finite pulse train. You designate the main one explicitly and then under the hood DAQmx uses the other one to act as a gate (a.k.a. a Pause Trigger) to control the exact amount of time the main one is enabled such that you get the correct finite # pulses. So only 1 counter of a pair can generate a finite pulse train at a time. Pick any 2 counters that aren't paired and it'll work.
Note: asking for a 1-pulse finite pulse train seems to be a special exception. Once upon a long time ago, DAQmx threw errors for this usage, declaring that 2 pulses were the minimum # allowed in a finite pulse train. I suspect that restriction is still true technically, but DAQmx has enough smarts to configure *single* pulses for you instead of finite pulse trains with a count of 1.
-Kevin P
09-22-2022 12:02 PM
Thanks Kevin.
Ultimately, I will need to use all 8 counters of PXI-6602 to form 4 pairs of signals (4 channels).
So, the correct combination is:
ctr0/ctr2
ctr1/ctr3
ctr4/ctr6
ctr5/ctr7
Is this correct?
09-22-2022 12:18 PM
I'm not entirely sure I understand what you're saying.
You should be able to produce 4 simultaneous finite pulse trains by explicitly programming 4 of your counters. Each of those counters will consume the one its paired with, so the 4 you explicitly program can't contain both counters from any of the pairings.
So you could program explicitly for ctr0, ctr2, ctr4, ctr6 because they're all part of different pairings. Or you could use 0,3,5,6 or any other combo that only uses 1 counter from each pairing. The remaining 4 counters would then be reserved to act as paired helpers and not be available for programming.
-Kevin P
09-22-2022 12:39 PM
OK.
Is this a true statement:
If I use
ctr0/ctr2 and ctr4/ctr6
I can not use
ctr1/ctr3 and ctr5/ctr7
with them for double pulse generation?
09-22-2022 01:09 PM
I'm not sure why you *seem* to be referring to the following as though they are pairs:
ctr0/ctr2
ctr4/ctr6
And I don't know your exact definition of "double pulse generation".
I'll restate what I know to be true of the 6602. The max # of simultaneous *finite* pulse trains possible is 4, using 1 from each of the following pairs: (0,1), (2,3), (4,5), (6,7). Each one you explicitly program will in turn reserve its own paired counter, making it unavailable.
(Note: single pulses or continuous pulses do *not* consume the paired counter, so you can have up to 8 of them simultaneously.)
Do you have any newer DAQ hardware available? Many newer devices (starting circa 2010 with X-series) no longer need to use 2 counters working together to make a finite pulse train, they can do it with just 1 counter.
And taking a step back, what is the app all about? What's the external triggering signal? What's the purpose of multiple distinct and possibly delayed pulse trains? Just trying to figure out if a different approach might be workable...
-Kevin P
09-22-2022 01:43 PM
I'll try to be more specific.
This is acoustic sensor test in which I have to drive 4 channel transmitter with double pulse train. Each channel has 2 drive lines (+) and (-). I need 8 counters( 2 per tx channel = 8). The pulse train must be in specific time order. See the snippet.
In my original post, I attached a simplified version of my LabVIEW code with only 4 counters, here is attached the actual test VI that uses all 8 counters.
The trigger is a pulse that comes from PXI-6602 Digital output every 500 mSec.
This VI works with 1 Sample cycle. I am trying to use this old PXI-6602. I understand there are new time-based PXI products, but that will expense the project.
09-22-2022 04:20 PM
Thanks. And then sorry to say but no, you won't be able to do that with the 6602, not with 2 pulses for each of 8 counters.
A newer dedicated counter timer card like the PXIe-6612 *could* do it, but you'd need a chassis that supports PXIe. Another likely advantage of the newer device is a configurable behavior about how it treats delay after the first trigger vs. subsequent ones when set up to be retriggerable. As far as I know the 6602 would be stuck with the less-desirable behavior illustrated in this article.
But beware, the article looks to have been edited in recent years and made to be no longer fully true and relevant, at least according to my memory of it. In particular, the article is all about "initial delay" but the example never even tries to define it for the counter tasks it shows. Still, it's mostly pretty good and the best I could find to explain the problem.
A better example for a solution can be found here. I don't think it'll work for your 6602, but I suppose it wouldn't hurt to try and find out for sure.
-Kevin P