BreakPoint

cancel
Showing results for 
Search instead for 
Did you mean: 

Are globals really THAT evil?

That's the idea..

 

See how great minds think alike..  It is possible to make a Global WORM, call it a CONSTant. 

 

<punt ON>

Would it be referred to as "Global WORMing?"

<punt OFF>

0 Kudos
Message 41 of 89
(12,083 Views)

Isn't this kind of easy to do with LVOOP?

 

A write function which allows only a single execution, otherwise returning an error?

 

Shane

Message 42 of 89
(12,079 Views)

Intaris wrote:

Isn't this kind of easy to do with LVOOP?

 

A write function which allows only a single execution, otherwise returning an error?

 

Shane


 

I don't remeber which thread I posted this image too but YES!

 

Constant.png

Ben

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

Time for a Nugget guys....

 

0 Kudos
Message 44 of 89
(12,054 Views)

Ray.R wrote:

Time for a Nugget guys....

 


 

Owww!

 

Are you writing one?

 

BTW: Shared Variables have a single writer option.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 45 of 89
(12,050 Views)

Although I like the LVOOP idea, Globals as they are satisfy my need for constants, so I won't go through the trouble of creating a WORM Globabl using LVOOP.  Well I might one day when I have some time on my hands (like next week).  For me its OK the way it is because I am keenly aware of the troubles of misusing Globals.  I have disciplined myself to never write to a Global in a block diagram.

 

But I like the idea of a WORM Global because I would be able to load the Globals from an ini file at the beginning of each program.  This would really be a great feature.

 

- tbob

Inventor of the WORM Global
0 Kudos
Message 46 of 89
(12,044 Views)

Ben wrote:

 

BTW: Shared Variables have a single writer option.


Then that's the way to go if you want to do this.

 

BTW. How about a new feature where Local and Global variables can not be placed on the block diagram until you have two years of LabVIEW experience? Smiley Tongue

Richard






Message 47 of 89
(12,043 Views)

Broken Arrow wrote:

Ben wrote:

 

BTW: Shared Variables have a single writer option.


Then that's the way to go if you want to do this.

 

BTW. How about a new feature where Local and Global variables can not be placed on the block diagram until you have two years of LabVIEW experience? Smiley Tongue


 

There was an early version of LV where NI tried a "just in time help" function that was borderline as anoying as Clippy from MS.

 

I think that there should be a EULA associated with every instance of a write global that we have to agree to and Ni keeps on file.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 48 of 89
(12,036 Views)

I like these WORM globals. Two implementations come into my mind.

* LV2Global with the First Call prim to load the values from a ini file

* Using a SEQ with an enqueue as write (with timeout 0) but a preview for read

 

But I must confess, that I really do use those evil globals to pass data around. It's duct tape I use to fix things in the field. And I am very happy if I have the time back home and remove them again...

 

Felix 

Message 49 of 89
(11,976 Views)
Does this sound like an application for a Singleton?  I've never tried one before, but I did sleep at a Holiday Inn last night.
Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

Message 50 of 89
(11,972 Views)