LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

control changes

Hi

I am often in the situation, that I need to do sertain calculations, whan
one control canges, but I do not what to do it all the time - is there some
way to do that in labview? (I know that I can make an copy of my control and
then then test for changes, but I do not think that is an optimal solution).


Yours Denis
0 Kudos
Message 1 of 3
(2,777 Views)
If i understand you, you want know when control value changed?
I'm using my VI for this purposes. You have connect control reference to this VI and you will get boolean value: Changed?
You can use it with multiple instances in your VIs. This VI remember all connected controls and their last values.

Look attached VI.
Message 2 of 3
(2,777 Views)
> I am often in the situation, that I need to do sertain calculations, whan
> one control canges, but I do not what to do it all the time - is there some
> way to do that in labview? (I know that I can make an copy of my control and
> then then test for changes, but I do not think that is an optimal solution).
>

If the control change you are interested in is caused by user
manipulation, and you have LV 6.1, then you can use the event structure.
You configure it, so that it knows which value changes or other events
you are interested in, and when the user causes those to occur, your
diagram executes -- the rest of the time it sleeps.

I mention that it is user events because if you are setting the value
programmatically, then the event structure will no
t fire -- to avoid
infinite loops. In this case, you can build up a subVI that you call,
or a parallel loop that you send an event to.

If you do choose to do this without events, the best way to make the
copy of the value to do the comparison, is to use a shift register.
Also, if you have many controls you are interested in, you can make a
cluster of the controls and do the storage and comparison all at once.

Greg McKaskle
0 Kudos
Message 3 of 3
(2,777 Views)