LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Real-Time Front Panel Updating

Solved!
Go to solution

Hello dear colleagues,

 

I am working on a program for testing a printed circuit. The issue is that I would like to show the progress of the test on the front panel in real time. I found global variables to be quite useful but they are not exactly what I am looking for, since the writing to the variable does not influence indicators reading from it instantly (naturally).

 

 

So the solution I came up with is to have 2 loops: A first one where the subVIs and the subsubVIs are executed and write their date to the global variable as soon as it becomes available. And a second loop which runs simulaneously and constantly passes the date from global variable to indicators. 

 

However this 2-loop solutions feels odd to me. Is there a better way to update the front panel in real time? Something like pointers or references? I tried property nodes and "references" but they both only work locally...

 

I whish all a pleasant day

Tarik

0 Kudos
Message 1 of 4
(2,885 Views)

It may be useful to post some code. The two-loop solution is a standard design pattern in LabVIEW - navigate to File->New->VI from template->Master/Slave design pattern. This uses a queue rather than a global which is the preferred solution.

 

You could stick it all in one loop, however- it might not make a lot of difference to the performance but you will need to test this by measurement. Of course, there's no point repeatedly sending the same data to the front panel, which you may be doing with your global unless you've got some signalling scheme to ensure that doesn't happen. Using the queue in the master/slave pattern that can easily be avoided.

Message 2 of 4
(2,867 Views)
Solution
Accepted by topic author Tarik_Ilhan

I typically have a loop that does nothing but GUI: users pressing buttons/changing numeric controls and/or updating indicators.  So my thing is to use User Events to pass data from subVIs and parallel loops to the GUI.  The Event Structure will see the event and you can just write directly to the indicator's terminal.  It works very well and is a lot more expandable than the global method.  It also doesn't poll, so you are not wasting CPU and memory resourses to update an indicator that doesn't actually need updated.


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
0 Kudos
Message 3 of 4
(2,862 Views)

This is exatly what I have been looking for. The notification is fine but with an event I do not even need the global variable, which is great! Sadly I have not been able to get it working. I have been using this as reference but I seem to have missed something. Where did I fail?

0 Kudos
Message 4 of 4
(2,836 Views)