LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

indicator control



Ben wrote:
...
I play a game while developing where I win if I don't use any locals.
...

Ben


Hi Ben,
i play the same game, and i always win. Smiley Very Happy
Mike
Message 11 of 52
(1,850 Views)


@MikeS81 wrote:


@Ben wrote:
...
I play a game while developing where I win if I don't use any locals.
...

Ben


Hi Ben,
i play the same game, and i always win. Smiley Very Happy
Mike


Globals are equally evil Smiley Mad
Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
Message 12 of 52
(1,844 Views)
Hi Norbert,
you are right. I enlarge the rules. I only win without using locals and globals, but the result is the same, i always win. Smiley Very Happy
Mike

Message Edited by MikeS81 on 05-13-2008 04:19 PM
Message 13 of 52
(1,837 Views)


mathan wrote:
Championsssssssss Smiley Wink
 
I have 2 indicators. If any one of the indicator got a value other than zero, the vi should stop running Smiley Wink . I tried to achieve but in vain. Smiley Sad please give me a sample structure.
 
Mathan


As Ben suggested, the problem is most likely due to a race condition because you are using Local Variables that are read before new values are written to them, thus if they are initialized to zero, it will read zero.
 
Wire directly. 
 
RayR
Message 14 of 52
(1,826 Views)

I aggree that this example code, is an example to be avoided, about using local variables.

But i dissagree, that they are evil. They are many, even in the Labview examples.

It is not always possible to have a wire. You just have to be carefull, how you use them.

If you don't use local variables at all, you will be forced to use a few more sub-vis, or a notifier, or something.. That makes the program bigger, and a little slower.

I use the fewer i can, and with caution.. but i use them and i like them..

Message 15 of 52
(1,816 Views)
With all due respect to the NI engineers and programmers that have written subVIs and examples for LabVIEW, there are many instances of poorly written code and code that breaks NI's own guidelines on how to write a LabVIEW program.
Message 16 of 52
(1,820 Views)


JoeLabView wrote:

I would have given Gerd 20 stars if I could.  Listyen to his advice, it is good.

Why are you using Local Variables?  Don't tell me that they are the same as the indicators coming out of the two sub-vi's!!

 




😞 What about me? I said it first 😞

<sniff> <sniff>

________________________________________________________

Use the rating system, otherwise its useless; and please don't forget to tip your waiters!
using LV 2010 SP 1, Windows 7
________________________________________________________
Message 17 of 52
(1,807 Views)


@Pnt wrote:

[...]
But i dissagree, that they are evil.[...]





If there is nothing evil, how do you that something is good???? Smiley SurprisedSmiley Very Happy

Norbert
Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
Message 18 of 52
(1,801 Views)

JLV views his threads in reverse order (newset to oldest) so I suspect he was already fired up and posting before he got down to (or up to) your post.

Here have some well earned stars for "fighting the war on Locals".

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 19 of 52
(1,797 Views)
"If there is nothing evil, how do you that something is good????  "
 
Getting philosophical on us are you?
 
Its easy if you do not look at good as the oposite of evil but rather define good as the absence of evil.
 
Hmmmm? Smiley Wink
 
Ben
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 20 of 52
(1,789 Views)