LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Generate a event every X seconds and reseting a counter

Solved!
Go to solution

Hi!

 

I'm quite newby in programming in Labview and I need your help.

 

I've programmed a counter that is send to a MySQL database every time I click a button. Now I want to change this click event to an event ocuring every X seconds and that every time this event occurs it resets the counter. How can I do that?

 

I think it's not a difficult question for someone used to programming Labview but I can't find an accurate solution.

 

Thanks a lot.

0 Kudos
Message 1 of 4
(3,052 Views)
Solution
Accepted by topic author lisonjero

Insert an event structure inside a while loop, and write you code (for example, set the counter to 0 using a local variable) in the "timeout" event.

Wire desired period to the hourglass terminal.

Regards

Message Edited by xdaf on 12-16-2009 05:37 PM
0 Kudos
Message 2 of 4
(3,045 Views)

Something like this?

 

 

Jean-Marc

0 Kudos
Message 3 of 4
(3,036 Views)

Thanks a lot.

 

I've tried your solution xrdf but if I put a 0 in the local variable associated to the counter I don't know why but it seems that it's always timeout, as the counter always shows a 0 but I've tried to put this local variable in the event and now it makes what I need.

 

J-M, your solution is excellent, even more than what I need, it solves my problem in generating an event every X seconds.

 

Thanks a lot guys! 

 

 

0 Kudos
Message 4 of 4
(3,019 Views)