LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Help with Sub VI updating on Front Panel

Solved!
Go to solution

Hi,

I was hoping to get some assistance on this. I have been searching for hours but cannot really find a solution.

 

I am using a USB-DAQ to obtain multiple voltages from a board I am testing. No problem there as I can easily create a VI to pull that data.

 

My main VI changes some values of that board under test and I want to pull this voltage data multiple times and display it on the front panel. The problem is, is that when you call a sub-vi multiple times and want to display the data, you have many instances of the vi result rather than one updated result......result-2, result-3, result-4.

 

All I want to do is change the settings of my board under test and display one updated value on the front panel. I am not sure how to do this. It sounds like it should be easy but I am having a heck of a time figuring it out. Seriously, I am about 4 hours in of trying and failing. I need some guidance.

 

Any assistance is appreciated.

 

Ryan

0 Kudos
Message 1 of 7
(3,285 Views)

Hi Korpz,

 

The problem is, is that when you call a sub-vi multiple times and want to display the data, you have many instances of the vi result rather than one updated result......result-2, result-3, result-4.

No, this usually is not the problem.

Two problems I see:

1. When you call a VI several times usually no additional instance is created! This (usually) only happens for VI templates…

2. You forgot to attach your VIs and so we cannot debug your code to provide detailed error descriptions…

 

I am not sure how to do this. It sounds like it should be easy

What about using a "regular" subVI in a loop instead of embedding one in a subpanel? (Things might be easier without additional VIServer stuff…)

Best regards,
GerdW


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

I think you should use property node for updating the Vi on Front panel during execution.

0 Kudos
Message 3 of 7
(3,270 Views)

The multiple VI's sounds like a reentrant VI in a parallell loop with Show on call-setting.

 

In general, you should use the Indicator outputs to transfer data up the VI hierarchy to the main UI.

If the program design prohibits this, generating events that the main UI reacts to and updates the indicators is a good way to go.

 As a last resort, wire the indicator reference to the data read and write directly to the indicator.

 

/Y

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

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 4 of 7
(3,245 Views)

GerdW,

 

I attached my main Vi along with the sub Vi. There are more VI's embedded so it is going to be broken. I did attach a photo of the front panel and block diagram of the main VI. As you can see, when I add a new instance to display voltages, it gives another indicator on the front panel (2), (3). I don't know how to simply update a single instance multiple times as I work through my block diagram. If you need more information, please let me know. I am trying to find the simplest and best solution for doing this and I appreciate all the help from everyone.

 

Thanks,

Ryan

 

Download All
0 Kudos
Message 5 of 7
(3,228 Views)
Solution
Accepted by topic author Korpz

Hi Korpz,

 

As you can see, when I add a new instance to display voltages, it gives another indicator on the front panel (2), (3).

I disagree to this sentence!

When you place the subVI again in the mainVI it will NOT automatically create a new indicator!

It is you who creates this additional array indicator…

 

I don't know how to simply update a single instance multiple times as I work through my block diagram.

Whenever you do things several times you should use a loop to repeat stuff.

Whenever you need to execute several states in a certain order you should use a statemachine approach!

Doing so would also make it VERY easy to display several measurement results in the very same indicator…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 6 of 7
(3,199 Views)
Spoiler
It has been a while since I worked with Labview. I looked up the state machine example in Labview and it worked beautifully! Thank you for all your help!

Ryan

Message 7 of 7
(3,171 Views)