08-29-2017 12:22 AM
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
Solved! Go to Solution.
08-29-2017 12:43 AM - edited 08-29-2017 12:45 AM
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…)
08-29-2017 12:47 AM
I think you should use property node for updating the Vi on Front panel during execution.
08-29-2017 02:40 AM
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
08-29-2017 06:49 AM
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
08-29-2017 08:37 AM
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…
09-02-2017 09:20 PM