Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

how to reset counter faster?

I use a PCI-6602 counter card. I use counter for retriggeble pulse generation application. The trigger pulse is about  15 Hz. The problem is that everytime we change the timing settings, such as low ticks, high ticks, etc, the counter needed to be stoped, and then applied the changes and then start again. This process takes time and we might missed one or more trigger pulses and get some gap for the pulse generation. I am wondering is there any way to make this process faster? to make sure that there is no gap when changing the settings so that we capture all the trigger signals. Thank you very much.
 
0 Kudos
Message 1 of 18
(6,819 Views)
Hi
 
You can set the following properties on TIO devices while the task is running.

Counter Output:Pulse:Time:High Time
Counter Output:Pulse:Time:Low Time
Counter Output:Pulse:Frequency:Frequency
Counter Output:Pulse:Frequency:Duty Cycle
Counter Output:Pulse:Ticks:High Ticks
Counter Output:Pulse:Ticks:Low Ticks
 
You can fine more information in LabVIEW help (help>>search the LabVIEW help  ... >> Context tab >> VI and Function References >>measurement I/O VIs and Functions >> DAQmx>>additional information>>properties settable at task run time>>TIO Devise
If you use LabVIEW context help on the items you are interested with it will show you more information
 
Here is an additional link that might be useful it really to do with resetting the counter but not its attributes.
I
f you have any further problems can you give some specific details

Regards
 
Tim
 
AE NI UK and Ireland technical support
0 Kudos
Message 2 of 18
(6,804 Views)

Counter Output : Pulse:Time:High Time
Counter Output : Pulse:Time:Low Time
Counter Output : Pulse:Frequency : Frequency
Counter Output : Pulse:Frequency : Duty Cycle
Counter Output : Pulse:Ticks:High Ticks
Counter Output : Pulse:Ticks:Low Ticks

 

 

🙂

0 Kudos
Message 3 of 18
(6,801 Views)

Dear Tim,

         Thanks a lot for you reply. I tried to use channel properties to change the "high ticks" and "low ticks" of the counter when it is generating (retriggerable) pulses. But it gave an error of -200557, which said "Specified property cannot be set while the task is running. Set the property prior to starting the task, or stop the task prior to setting the property." My counter card is pci-6602, and my labview is 7.1. The counter was set to generate retriggerable pulse based on ticks from external clock and triggered by external trigger signal. Could you please tell me how to reset this counter when the task is running? I am not sure whether I did it the right way or not. Thanks a lot.

 

Best regards,

Xiaowei

0 Kudos
Message 4 of 18
(6,790 Views)
Though you can use the property nodes directly, you are better off using the counter write VIs.  Be sure to use the same type between the create channel and write VIs.  That is both should match on Freq/Duty Cycle, High/Low Time, or High/Low ticks.
 
Let me know if you still get an error on this.
gus....
0 Kudos
Message 5 of 18
(6,777 Views)

gus,

I'm curious -- why is it better to use the 'DAQmx Write' vi instead of the property node?  Should I unlearn a habit?  In areas where I was changing things "on the fly", I've typically used the property nodes.  I guess I sorta assumed that since some of the low-level functionality is only exposed through the property nodes that they would also be the more efficient interface.

-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 6 of 18
(6,769 Views)
Dear Gus,
        Thank you very much for your reply. I used the counter write VI as you mentioned, but still get warnings "-200459". I wonder whether it is possible to change the timing settings, e.g. "high/low ticks" without stopping the task? I pasted my program in the attachment, so you could get a better idea of what I have been doing, and hopefully correct some mistakes that I may have made, as I am not quite familiar with counter and DAQmx. Thanks a lot!
 
Best regards,
Xiaowei
0 Kudos
Message 7 of 18
(6,766 Views)
In general, it's best to use the write VIs because you have to keep track of which property node actually commits the new values to hardware when you use the property nodes.  For a number of people it also makes more sense because then you see the direct correlation between the create channel VI and the write VI.  Also, I haven't benchmarked it in a long time, but I remember the write VI being a little faster than doing two property node writes.  Either way works just as well, but the "preferred" method will be the VI. 
0 Kudos
Message 8 of 18
(6,761 Views)
I should have asked before, what version of NI-DAQmx are you using?
0 Kudos
Message 9 of 18
(6,761 Views)

I am sorry that I did not mention that. To be honest, I am not quite sure as I don't know how to check. Actually, my labview version is 7.1, and I just used the default DAQmx version that comes with this labview version. I think it should be 7.0. 

 

0 Kudos
Message 10 of 18
(6,752 Views)