LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Writing Values To Front Panel Controls (Most Efficient Method)


@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

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

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 11 of 33
(1,432 Views)

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.

Doug

"My only wish is that I am capable of learning each and every day until my last breath."
0 Kudos
Message 12 of 33
(1,427 Views)

@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

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

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 13 of 33
(1,421 Views)

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

Doug

"My only wish is that I am capable of learning each and every day until my last breath."
Message 14 of 33
(1,418 Views)

@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

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

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 15 of 33
(1,415 Views)

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

Message 16 of 33
(1,403 Views)

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.


GCentral
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 17 of 33
(1,374 Views)

Very nice. I have not been using this function but I will now. It's as fast as a local variable!

 

------------------------------
All statements are my opinion and worth every cent you paid for them.
Tom Whitaker, CLD
- - - - - - - - - - - - - - - - - - - -
"Give every man thy ear but few thy voice."
Polonius in Hamlet.
Message 18 of 33
(1,368 Views)

@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 AttachmentMethods 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!

0 Kudos
Message 19 of 33
(1,322 Views)
Message 20 of 33
(1,314 Views)