LabVIEW Idea Exchange

cancel
Showing results for 
Search instead for 
Did you mean: 
WSmith

Local Variable Page

Status: Declined

Any idea that has received less than 2 kudos within 2 years after posting will be automatically declined.

Wouldn't it be nice to the have a local variable page like the global variable page.

 

Front panel objects are local variables but sometimes it is not always desirable to see this local variables. There are three options around this: 1) put the local variable off to the side side of the visible display, 2) make the local variable hidden, or 3) use a global page. By putting these variables on a global page they are no longer local and be be changed by other VI's. The scope of a local variable needs to be limited to the VI that uses it. While it possible to use the first two workarounds and make local variable hidden or put them off to the side it makes the front panel messy. Things are complicated even more because if local variables are double-clicked on the block diagram because it brings focus to them on the front panel and this can be a problem if the front panel has a status bar or a toolbar and things are carefully arranged.

 

Another possibility would be to enhance the functionality of the block diagram constants so they can be variables.


 

14 Comments
tst
Knight of NI Knight of NI
Knight of NI

>This thread and tst's node shows once again that one of us (NI developer, tech writer, or enthusiastic user) needs to actually write up a central document we can all point to that covers local, global, functional and network share variables, and explains the race condition problem and the data copy problem.

 

 

 

 

Hey, you'll get no argument from me.


___________________
Try to take over the world!
tst
Knight of NI Knight of NI
Knight of NI

AQ, here's a good base for revising - http://zone.ni.com/devzone/cda/tut/p/id/5317


___________________
Try to take over the world!
Casey
Member

I was explaining how Labview (use to) work with screen updates to someone and they showed me new, and unexpected behavior in LV2011.  It use to be that a counter with a shift register would run faster than one with locals; now it seems over the past few versions, and given multicore processors, this is no longer true.  I wrote some test code and these are now the same, which is good, I guess.  However, a simple loop that is incremented using locals now runs 2x slower if the local is hidden.  This confounds me.

 

If the indicator in the loop is displayed, execution of 1M loops takes 57ms.  But, with the indicator hidden it's 130ms.  Any idea why?  This behavior seems totally backward.  Screen updates are synchronous.

 

I assume this has something to do with the interaction between the UI thread and the transfer buffer, but I still don't understand:

 

http://zone.ni.com/reference/en-XX/help/371361H-01/lvconcepts/vi_execution_speed/  says:

"When you write to a local or global variable, LabVIEW does not switch to the user interface thread immediately. LabVIEW instead writes the value to the transfer buffer. The user interface updates at the next scheduled update time. It is possible to update a variable multiple times before a single thread switch or user interface update occurs. This is possible because variables operate solely in the execution thread."

 

Can anyone explain this?

ShiftRegisterCounter.jpg

 

Darren
Proven Zealot
Status changed to: Declined

Any idea that has received less than 2 kudos within 2 years after posting will be automatically declined.