BreakPoint

cancel
Showing results for 
Search instead for 
Did you mean: 

Are globals really THAT evil?


@JÞB wrote:

@Ben wrote:

@JÞB wrote:

@Ben

...At least twice today I was chasing down all of the references to a global when I was confounded why "ctrl-e" was not working. Of course ctrl-e does not work when looking a the global itself that does not have a block diagram.

 

Toss_LV.gif

 

Ben


It does have a block diagram Ben and it will execute


I will let you explain that.

 

Ben


WARNING! DO NOT GO HERE! Create a static reference to Global.vi 

Ctrl+double click 

Rinse out your eyes and forget what you saw.

 

(unless you want to write the call- chain and time to a log. which, you might want to do... You may be able to export the image of the FP never tried, but I would never try to read a value since that might recurse)


That did not work for me in LV 2017.

 

Do you by any chance have scripting turned on?

 

I do not.

 

That could be handy for trying to chase down a race condition but ... now I am going to be repeating myself.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 81 of 89
(9,564 Views)

@JÞB wrote:

WARNING! DO NOT GO HERE! Create a static reference to Global.vi 

Ctrl+double click 

Rinse out your eyes and forget what you saw.


This was apparently fixed somewhere between LabVIEW 8.2.1 and LabVIEW 2016 (sorry, I do not have any more versions installed between those).  But messing around a little more in 8.2.1 shows that this works with ctrl files as well.  Errors in the block diagram also react as if you have an invalid control for both global VIs and ctrl files.


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 82 of 89
(9,560 Views)

2013 will show me an empty BD as well as LV 2010.

 

I may be better off having never seen it since knowing myself I would have tried to exploit it only to find out it was "fixed".

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 83 of 89
(9,555 Views)

@crossrulz wrote:

@JÞB wrote:

WARNING! DO NOT GO HERE! Create a static reference to Global.vi 

Ctrl+double click 

Rinse out your eyes and forget what you saw.


This was apparently fixed somewhere between LabVIEW 8.2.1 and LabVIEW 2016 (sorry, I do not have any more versions installed between those).  But messing around a little more in 8.2.1 shows that this works with ctrl files as well.  Errors in the block diagram also react as if you have an invalid control for both global VIs and ctrl files.


Fixed in 2014 as well!  But, there really is a block diagram - the IDE just doesn't let you get to it anymore.


"Should be" isn't "Is" -Jay
0 Kudos
Message 84 of 89
(9,554 Views)

@Ben wrote:

2013 will show me an empty BD as well as LV 2010.

 

I may be better off having never seen it since knowing myself I would have tried to exploit it only to find out it was "fixed".

 

Ben


Yeah, how would you ever make changes to the BD after updating?

OT: Ben, There is a thread I want your input on. around a single edged flat surface


"Should be" isn't "Is" -Jay
0 Kudos
Message 85 of 89
(9,551 Views)

Like a Mobius strip or a disk?

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 86 of 89
(9,545 Views)

like a disk with the edge width perpendicular to the floor


"Should be" isn't "Is" -Jay
0 Kudos
Message 87 of 89
(9,541 Views)

@JÞB wrote:

@crossrulz

Fixed in 2014 as well!  But, there really is a block diagram - the IDE just doesn't let you get to it anymore.


Polymorphic VIs have a block diagram too, and it contains subVI calls to each of the instances. You used to be able to see that diagram too with a few tricks, but they closed that hole a while back as well.

0 Kudos
Message 88 of 89
(9,510 Views)

@Ben wrote:

I am trying to upgrade an application that was developed by some other person and I am getting smacked in the face by globals. Not because of the previous reasons but for a new reason that I want to add to the list.

 

At least twice today I was chasing down all of the references to a global when I was confounded why "ctrl-e" was not working. Of course ctrl-e does not work when looking a the global itself that does not have a block diagram.

 

Toss_LV.gif

 

Ben


It is interesting the perspective on Globals.  One employee (CLA) is okay with them.  I'm...  euh... humm...

 

Well...  For a good portion of my LabVIEW career, I was debugging and refactoring cr@...-p... badly written by less than novice programmer who would use Globals as much as rain fills a river...  Globals for everything.  Wires??? Nah.... let's just use a Global or Local or a mix of both.  So many globals that it would make anyone turn green and evacuate those green global goblins at the end of the day...

 

Are Globals really that evil?  It's not the Globals its how they are used... 

 

I feel your pain Ben..Toss_LV.gif  Toss_LV.gif  Toss_LV.gif

0 Kudos
Message 89 of 89
(9,359 Views)