04-23-2018 07:12 AM
Hi,
I have done a code in which, I have created a subvi and used it in another vi. But I have 3 inputs as push buttons in the subvi and I have included them as input terminals and in the main vi, I placed 3 buttons to those 3 input terminals. But when I run the program and push the button in the main vi, the button inside subvi is not turning on. I did not know this before. Is there any way to solve this. Kindly do reply. Thanking You.
04-23-2018 07:23 AM
Post your vi's. It's hard to give an answer without them.
04-23-2018 07:38 AM
04-23-2018 01:16 PM
Hi Govind,
At the moment the SubVI is called, it will take the current values at all of its inputs. If you do not call your SubVI, the inputs will never be updated.
04-23-2018 01:22 PM
Also, if the button is set to any of the latching mechanisms, it will not visually appear like the SubVI button is pressed (on the front panel).
04-23-2018 01:40 PM
Is the subVI interactive or does it return immediately? We clearly need to see some code.
04-23-2018 01:51 PM
My wild guess is that you've done something like this:
and that you're expecting that while the subVI is running, it should be able to read changes in the value of the button in the calling VI. That won't happen. When the subVI starts executing, it receives the value of the button at that time. It does not receive updates if the button value changes.
04-23-2018 03:04 PM
@paul_cardinale wrote:
My wild guess is that you've done something like this:
and that you're expecting that while the subVI is running, it should be able to read changes in the value of the button in the calling VI. That won't happen. When the subVI starts executing, it receives the value of the button at that time. It does not receive updates if the button value changes.
If the subVI does not contain a loop and returns immediately (but keeps the panel open), the FP will update whenever the button is read in the caller. Thus my earlier question.