LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Single shot routine

Hi
I am trying to add a routine to my labview 5.1 program so that when a button
is pressed it
will enter a routine that saves to disk a number of parameters.

I only want to do this each time the button is pressed an save one line of
data
with a time stamp.

I am not sure what the best way is to do it, so if anybody has done this
before or can sugest the best way of doing a
one shot routine, I would be most grateful for the help.

Thanks

Allan
0 Kudos
Message 1 of 2
(2,812 Views)
Hi Allan

Have you tried changing the mechanical action of the button? The mechanical
action 'Latched when Released' will only be 'True' until the data has passed
from it, so will do the action you required.

The only problem with 'Latched when Released' is that local variables won't work
with it. The way around this is to use a compatible mechanical action that can
be set when the user presses the button and then the actioned event can then
reset the button via a local variable.

Another way of making sure an event is only actioned when a button or other
control has been changed, is to hold the current state in a shift register (in a
while loop) and compare the last state, from the shift register, to the current
state of the control. As soon as the cur
rent state and old state are not equal
the action the event.

Hope this helps

Tim

Allan wrote:

> Hi
> I am trying to add a routine to my labview 5.1 program so that when a button
> is pressed it
> will enter a routine that saves to disk a number of parameters.
>
> I only want to do this each time the button is pressed an save one line of
> data
> with a time stamp.
>
> I am not sure what the best way is to do it, so if anybody has done this
> before or can sugest the best way of doing a
> one shot routine, I would be most grateful for the help.
>
> Thanks
>
> Allan
Message 2 of 2
(2,811 Views)