From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Buttons as input in subvis

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.

0 Kudos
Message 1 of 8
(2,775 Views)

Post your vi's. It's hard to give an answer without them.

Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
0 Kudos
Message 2 of 8
(2,764 Views)

Hi govindsankar,

 

you probably have to THINK DATAFLOW to solve the problem!

 

You can expect more specific answers after posting your VIs…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 3 of 8
(2,758 Views)

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. 

0 Kudos
Message 4 of 8
(2,714 Views)

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).

0 Kudos
Message 5 of 8
(2,712 Views)

Is the subVI interactive or does it return immediately? We clearly need to see some code.

0 Kudos
Message 6 of 8
(2,709 Views)

My wild guess is that you've done something like this:

Clipboard.jpg

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 you weren't supposed to push it, it wouldn't be a button."
0 Kudos
Message 7 of 8
(2,707 Views)

@paul_cardinale wrote:

My wild guess is that you've done something like this:

Clipboard.jpg

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.

0 Kudos
Message 8 of 8
(2,697 Views)