See on the Brian Renken's site the Changed VIs.
http://Brian.Renken.com/LabVIEW/
Put in a loop and reading a control, these VIs detect a change of the input
value from the previous call.
Use the output to call another VI when a change is detected. You can modify
it to accept any data type.
Alternatively you can add some code in the change detection VI to call
another VI from within. You simply add an input to accept a VI path or name
to call a VI after opening a reference to it, or to accept a VI reference
directly.
VI reference is LabVIEW equivalent to function pointer.
It is only few pointers, post again for any other questions.
Regards,
Jean-Pierre Drolet
Scientech R&D inc
Cap-de-la-Madeleine (Quebec)
CANADA
Brett L. Moore a �crit dans le message :
3964af59.184382337@news.randori.com...
>
> Hi,
>
> I am looking for a *good* means of performing some action when the
> state of a control changes. For example, perhaps I would update the
> size of an array when a Numeric Control was changed. In CVI, I would
> have use a callback to do this. Unfortunately, I see no efficient way
> to do this in LabVIEW.
>
> For example, I posted a similar question some time ago and I received
> a response or two confirming my worst fears:
>
> The only way to do this is to set up a loop (hopefully with a wait so
> that the CPU is not slammed) to check the current value and compare to
> the old value. I do not guess that this is so inherently bad (for
> this is the sequence of actions that has to occur on some level
> anyway), but this technique does not lend itself to a modularized
> implementation.
>
> For example, one would expect a VI to handle the read and compare
> operations - then call another VI if a change was noted. However, I
> cannot determine a means of passing a VI (like a function pointer in
> C/C++). Thus, I am left with hardwired connections and a different
> read/compare VI for *each* control that I want to test. Blech.
>
> Surely there is a better way. The undying gratitude of a bunch of PhD
> students awaits the poster with a better solution!
>
> Brett
>
>