LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Problem on reset counter

Hello,

 

I did a counter with reset (Labview 2013) part as shown on a previous discussion :

https://forums.ni.com/t5/Example-Programs/Count-Digital-Events-with-Option-to-Reset-Counter-Using-DA...

I think I have a problem on printing the value because in "hightlight mode" I see the number of count but in normal execution it's always zero in the counter ?

Do you have an idea about the problem ?

 

Thanks,

 

AB

0 Kudos
Message 1 of 3
(2,216 Views)

Hello AB,

In the screenshot "Counter highlight execution" the button "Reset Counter" is true, so the task gets stopped and restarted in the loop and I assume "Reset Counter" is true in the other screenshot too.

 

In highlight mode the execution of the code is delayed, so between "DAQmx Start Task" and "DAQmx Read" there is "some time" in which the device can count edges. In normal execution there is nearly no time between "DAQmx Start Task" and "DAQmx Read", so the count is (almost always) equal to zero.

 

I do not see a problem in the code, just a difference in execution speed.

UliB

0 Kudos
Message 2 of 3
(2,175 Views)

Hello UliB,

 

Yes, the counter is reset in "hightlight execution" and "normal execution"

Ok, I understand and you are right.

I add some delay between the "DAQmx Start Task" and "DAQmx Read Task" and I count some event.

 

Thank you,

 

AB

0 Kudos
Message 3 of 3
(2,166 Views)