08-21-2014 03:45 PM
@dacad wrote:
But you cannot write directly to the front panel from two or three levels down in a sub-vi.
You can, if you send the reference in, but it's not optimal. The usual solution is to send the result up through the vi chain through indicators.
/Y
08-21-2014 03:54 PM
I have used references for certain things and clearly using indicators up threw the levels is commonplace but that requires the vi to run it's course to get the update.
My target is to determine the best option for updating the front panel (or even causing another action) while you are still in the lower level vi and want to continue there. Historically, I have used global variables but am migrating to shared variables.
Now ultimately, I will start using LVOOP but my work on that is not ready for prime time yet.
08-21-2014 03:58 PM
@dacad wrote:
My target is to determine the best option for updating the front panel (or even causing another action) while you are still in the lower level vi and want to continue there. Historically, I have used global variables but am migrating to shared variables.
Ah, then i'd recommend to send events with the new information from the lower vi's.
/Y
08-21-2014 04:00 PM
Events you say.... I was not aware that an event could be sent from a lower level vi. Will have to play with that. There are other aspects to what I am doing but it's 5:00 and I am off tomorrow so my weekend starts now........
08-21-2014 04:02 PM
@dacad wrote:
Events you say.... I was not aware that an event could be sent from a lower level vi. Will have to play with that. There are other aspects to what I am doing but it's 5:00 and I am off tomorrow so my weekend starts now........
I'd say that's kind of the point of events, they can be sent from anywhere! 😄
/Y
08-21-2014 04:51 PM - edited 08-21-2014 04:55 PM
The Set Control Values by Index Function is the most performant way to directly change the value of a front panel object from a subVI. You can check the attached VI for a side by side comparison.
If I recall this function was added in 2013 as a way to perform updates on a massive number of front panel objects all at once. This example demonstrates updating only a single indicator, which there are less cubmersome methods available that accomplish the same thing with a similiar level of performance (e.g. set control value, value signaling).
08-21-2014 06:27 PM
I use events all the time for updating GUIs from other systems and/or subVIs. I can then write directly to the terminal in the event structure. Works very well.
08-21-2014 06:38 PM
Very nice. I have not been using this function but I will now. It's as fast as a local variable!
08-22-2014 10:48 AM
@David-A wrote:
The Set Control Values by Index Function is the most performant way to directly change the value of a front panel object from a subVI. You can check the attached VI for a side by side comparison.
If I recall this function was added in 2013 as a way to perform updates on a massive number of front panel objects all at once. This example demonstrates updating only a single indicator, which there are less cubmersome methods available that accomplish the same thing with a similiar level of performance (e.g. set control value, value signaling).
David-A,
Can you please post Methods for Updating the UI.zip 34 KB in LabVIEW 2013 format? I can't open any of the VIs because the version you are using is LabVIEW 2014. This is very helpful. Thanks for the info!
08-22-2014 11:28 AM