LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how can i recover last value after restart?

Hi, I did this counter for count triggers of an encoder, and I had a reset condition for start the counter from cero every time, but I lost the last value because the couner sends a 0 again, could you please tell me how can I recover this value before it becames 0 again? (Distancia recorrida(metros)2)
Download All
0 Kudos
Message 1 of 5
(3,350 Views)
you could save the data in a text file and read it back into your program.
Harold Timmis
htimmis@fit.edu
Orlando,Fl
*Kudos always welcome:)
0 Kudos
Message 2 of 5
(3,330 Views)

Lunazuly,

 

It is completely unclear what you are asking here.   What exactly is the behavior that is undesirable?  Is it that the counter is sending multiple zeros when the reset signal is sent?

 

Also, your diagram is set to run forever as when the outer loop is stopped the inner loop is started and there is no condition for stopping that loop.

 

Cheers, Matt

0 Kudos
Message 3 of 5
(3,323 Views)

I send again the vi with out the inner loop for the better untderstanding. This VI works with the other i posted yesterday (pul_con_mod2.vi),when  Almacena[1].vi runs start two counters if the reset botton is off, if the resete buttos is on one counter shows ceros thats ok, if I press the reset button the upper counter begins count again, thats ok too, but if I pressed the reset button again, the counter return to the begining and show ceros again thas fine BUT I want to see, to catch, to recover the last value after this ceros just the last value the counter shows just right before the reset, thats the problem. (Se aceptan respuestas en español,gracias)

0 Kudos
Message 4 of 5
(3,306 Views)

OK, so I still don't quite get all that you are trying to do (language thing I think and the code is pretty rough), but the jist is that you want to be able to recover a value right before or after an event occurs.  This seems simple enough - you need a place to store the value before you begin zeroing your counter; this can be either a shift register or a global variable.  This bit of memory can store the value and you should be able to read it back and do whatever you wish with it.  To do this, you will either have to poll the control to see if the status has changed or drop in an event structure with a value change event registered for the button Reset Signal.  When an event is fired or the changed status is true, simply store the value you are interested in before zeroing the counter indicator. 

 

Let me know if this is not clear.

 

Cheers, Matt

0 Kudos
Message 5 of 5
(3,276 Views)