LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Global Variables: Controls or Indicators?

When you create a new Global Variable Front Panel, you can drop both controls and indicators. You can change controls to indicators and vice-versa. Regardless of directionality of the FP object, the Global Variable acts the same from callers - both still have Read/Write capabilities.

 

So, is there any distinction between a Control and an Indicator on a Global Variable Front Panel?

0 Kudos
Message 1 of 7
(4,930 Views)
One distinction that comes to mind is that while a VI using a global is running I can open the global variable and muck with the values of the controls and not of the indicators.
Message 2 of 7
(4,917 Views)

Darin.K wrote:
One distinction that comes to mind is that while a VI using a global is running I can open the global variable and muck with the values of the controls and not of the indicators.

That's the only distinction I can think of as well.  For run-time debugging, you would want controls.  Shouldn't matter for any other purpose.  Personally, I always use controls, since the vast majority of globals I write are storing default values that I'm simply reading in various places in my code.  And semantically, it makes more sense to me that I'm reading from controls.

Message 3 of 7
(4,904 Views)
Good answers, those were my thoughts as well. So, why are indicators allowed on Global FP's?
0 Kudos
Message 4 of 7
(4,894 Views)

JackDunaway wrote:
Good answers, those were my thoughts as well. So, why are indicators allowed on Global FP's?

 

To mess with people's minds.  Smiley Very Happy

 

- tbob

Inventor of the WORM Global
0 Kudos
Message 5 of 7
(4,885 Views)

JackDunaway wrote:
Good answers, those were my thoughts as well. So, why are indicators allowed on Global FP's?

Indicators are there to be read-only whose value can only be changed at edit-time and thus provide a relatively efficient way to define constants.

 

Oops, I was dreaming there and just woke up.  I guess sometimes you need to keep those wacky users from messing with your data while your VI is running.

0 Kudos
Message 6 of 7
(4,881 Views)

Anyway, my thoughts about the indicator/control conundrum of Global FP's are half-formed at best, and as Darin has introduced, I'm thinking about a global CONST.

 

Could there be two types of Global Front Panels, one with only controls allowed (the current implementation of globals where all elements are read/write) and one with only indicators allowed (the CONST panel, all elements have read-only access)?

 

 

 

Message Edited by JackDunaway on 06-04-2010 12:50 PM
0 Kudos
Message 7 of 7
(4,862 Views)