06-04-2010 10:56 AM
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?
06-04-2010 11:43 AM
06-04-2010 11:59 AM
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.
06-04-2010 12:08 PM
06-04-2010 12:13 PM
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.
06-04-2010 12:15 PM
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.
06-04-2010 12:48 PM - edited 06-04-2010 12:50 PM
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)?