Discussion:
Algorithm to SubVI
(too old to reply)
StevenATK
2008-08-07 17:40:05 UTC
Permalink
I created a VI to verify that a data file is formatted correctly.  I simply created a file path control and LED indicator.  For development, I added an "OK Button" with the algorithm inside it's "Value Changed" event.  I now want to make my algorithm a subVI.  Would it be better to remove the event loop, or should I wire the OK Button to an input terminal to call the routine?
smercurio_fc
2008-08-07 17:40:08 UTC
Permalink
The latter part won't work because all that you'd be passing is the value of the Boolean, and the subVI would have no way of knowing if that's from a control or a constant. While you could pass in a control reference of the button and do dynamic event registration, that would be fairly pointless in this situation. Just have the subVI with the file path control and indicator. No event structure in the subVI. Keep the event structure in the main VI. When the user presses the button, call the subVI.
Loading...