LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Update main VI indicator while running subVI

I am new to labview and here is one naive question. I want to do the follwing:

 

Pass the value of one numeric indicator "A" from main VI to sub VI, change its value in the subVI (like do A=A+1 for 10 times), while updating the indicator in main VI immediately after each change in the subVI.

 

I know one way is to pass the refnum of the indicator to the subVI and use property nodes to set its value. But If I want to make A=A+1 in the subVI using property node, it seems I need to do it in two steps with a sequence structure. First read the value of A to some other variable B, then set its value to B+1; or a feedback node will automatically appear.

 

Is there a simpler way to realize my purpose (with condition that I only need pass one terminal into the subVI)? Like using global variable or some other methods? Thanks! 

0 Kudos
Message 1 of 8
(3,855 Views)

I'm sure you don't need a sequence structure to do what you are trying to do.

 

Post your VI's so we can see what you are doing now.  That will make it easier to suggest to you a better way of doing what you want.

0 Kudos
Message 2 of 8
(3,853 Views)

Thanks. Attached are the main and subVI.

Download All
0 Kudos
Message 3 of 8
(3,843 Views)

Here is a modified subVI with the sequence removed.  You don't need the X+Y indicator either unless you want to see the number within the subVI.

 

0 Kudos
Message 4 of 8
(3,827 Views)

@RavensFan wrote:

Here is a modified subVI with the sequence removed.  You don't need the X+Y indicator either unless you want to see the number within the subVI.

 


Thanks. Is It possible to use a single property node to do this?

0 Kudos
Message 5 of 8
(3,818 Views)

No.

0 Kudos
Message 6 of 8
(3,814 Views)

firephysix wrote:

Thanks. Is It possible to use a single property node to do this?


Assuming that you know that the the indicator will not be changed between iterations, you can save the value in a shift register.  This way you just need a property node to get the initial value and then you just use a second one inside of the loop to update the value.



There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 7 of 8
(3,785 Views)

Another solution is to insert the subVI in a panel and use/update the subVIs indicator. Then you only need to send in the start value and use the shift register as already shown.

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 8 of 8
(3,760 Views)