Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

How to specify gate and source using QAQmx on LabView 7.0

Re: "synchronous counting"

The DAQmx equivalent is the Duplicate Count Prevention property. It can be found by placing a DAQmx Channel Property node, then selecting Counter Input-->General Properties-->More-->Advanced-->DupCountPrevention. It takes a Boolean input, and I vaguely recall having to play with both True & False settings to get what I wanted. I think that True caused the behavior I would have expected from False and vice versa. Unfortunately, I don't presently have hw attached that'll allow me to test it. Try both and see which works!

-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 11 of 33
(2,911 Views)
Hello Kevin and mushi,

I believe Kevin is spot on with his advice on using Duplicate Count Prevention. In regards to his question concerning whether you can observe the count register value during a pulse train generation, there is a property located in the DAQmx Channel Property Node called "Counter Output>>General Properties>>More>>Count" which indicates the current value of the count register.

Hope this helps!
E.Lee
Eric
DE For Life!
Message 12 of 33
(2,908 Views)
You are Da man. Honest to god thanks so much

i will also post a vi that does this so anybody who needs to use it can
0 Kudos
Message 13 of 33
(2,904 Views)
Hey thanks! I coulda sworn I had tried exactly that property a while back without success. I remember being able to query the adjacent OutputState property successfully. For the sake of my sanity, has the behavior changed since an earlier version of DAQmx? Or is it hw dependent? The system I was on earlier had a 6602 and later an M-series board -- I'm not sure which I was using for the test. Now I've got a USB DAQPad-6016 and DAQmx 7.3.1.

Regardless, it's good to know the count property is available.

-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 14 of 33
(2,903 Views)
hi again;

This DAQmx is going to kill me but this is the last question. I want to setup a start trigger for my counters. in traditional DAQ I used to use the Counter Start Trigger (NI-TIO).vi now I am trying to use the property nodes of the trigger and it sais the device is not supported by it (I am using an M series 6229) anybody have any ideas of how to give a start trigger to the counter?

thanks in advance

mushi

Message Edited by mushi on 03-17-2005 03:12 PM

0 Kudos
Message 15 of 33
(2,902 Views)
Hi, me again. I'm afraid I can't speak from experience about the start trigger -- in my app, I synchronized measurements by controlling another counter that was used as a shared sample clock.

Unfortunately, the M-series help indicates that the Start Trigger is only for pulse generation tasks. Perhaps there's a chance that has changed recently?

-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 16 of 33
(2,895 Views)
mushi,

The property you are looking for is called Duplicate Count Prevention in DAQmx. You can find it under the channel property node by navigating through the following menu sequence Counter Input->General Properties->More->Advanced->Duplicate Count Prevention.

Kevin,

You can still read the current counter value while it is running by using the Counter Output->General Properties->More->Count property under the channel property node.
Message 17 of 33
(2,886 Views)
Hello Kevin and mushi,

1)For Kevin (and possibly mushi): I believe by default, the DAQmx property nodes are configured to filter out certain property settings based on what hardware you have configured in MAX. The behavior you experienced might be attributed to this. To look at what filters are being applied, you can right-click on the property node and click on "Select Filter..." to see what filters are being applied.

2)For mushi: The TIO chip is designed to be able to receive a digital start trigger to count events. I believe the M series boards use the STC2 chip, and even though the STC chips found in E series boards do not support digital start triggers for event counting, I believe the M series boards do. After you have configured your CI Count Edges Channel, use a DAQmx Trigger Property Node. The 3 properties we will be interested in are a) More>>Arm Start>>Trigger Type b) More>>Arm Start>>Trigger>>Digital Edge>>Source and c) More>>Arm Start>>Trigger>>Digital Edge>>Edge. I'm not sure why the property node said the device was not supported. You might want to try the filter settings as mentioned above. If this doesn't work out, you will have to use extra counters as Kevin mentioned. You can setup a counter to do a pulse generated started by a digital trigger and route this counter output into the source of the counter you will be using for counting.

Take care,
E.Lee
Eric
DE For Life!
Message 18 of 33
(2,880 Views)
Kevin-

You should be able to query the count of a pulse or pulse train generation reading the value of the "Counter Output->General Properties->More->Count" property. Let me know if you have any problems doing this.

Mushi-

The synchronous vs. asynchronous counting in DAQmx is set using the "Duplicate Count Prevention" property. You can read more about it in the NI-DAQmx help.

And as an additional plug NI-DAQ 7.4, which released on Wednesday, on top of all of the awesome features like simulation, programmatic save, etc. NI-DAQ 7.4 also has a slight change in behavior for the "Duplicate Count Prevention" property which will hopefully make it easier to use. Duplicate count prevention will now be on by default when using an external SOURCE pin (ie-one of the PFI or RTSI lines) as long as no prescalers have been configured. What this means for you, Mushi, is that with NI-DAQ 7.4, you shouldn't have to mess with the duplicate count prevention (synchronous counting) properties.

I hope this helps!
gus....
Message 19 of 33
(2,903 Views)


@E.Lee wrote:
Hello Kevin and mushi,

After you have configured your CI Count Edges Channel, use a DAQmx Trigger Property Node. The 3 properties we will be interested in are a) More>>Arm Start>>Trigger Type b) More>>Arm Start>>Trigger>>Digital Edge>>Source and c) More>>Arm Start>>Trigger>>Digital Edge>>Edge. I'm not sure why the property node said the device was not supported.

Take care,
E.Lee




This has really helped me, thanks

Now I am trying to use two counters Counter0 for frequency output I am using the output of Counter0 as the gate of counter1 and counter1 is supposed to count edges. As you can clearly see in the vi if you run it like this you will get an error once its reached the DAQmx start task. Now if you cut the error wire that conects the two counters (where it sais CUT HERE) an error apears on the DAQmx start task of counter1.

I have try to put theses two DAQmx strart task one after the other and allways the second one produces an error. Even if I change their order allways the second time I call DAQmx start task (for a completley different task) it gives me an error. What am I doing wrong? There must be a way of configuring two counters right?

thanks in advance

mushi

BTW thanks everybody who contributed to this thread all of you have been very helpful. This forum is much better than NI support honest.
0 Kudos
Message 20 of 33
(2,854 Views)