BreakPoint

cancel
Showing results for 
Search instead for 
Did you mean: 

Why some people say Local Variables are bad...

Performance of the property node would likely be the worst.  Not sure if Shared Variables would be in 2nd or 1st place though. 

 

The concern is not the performance issue, but rather the abuse issue.  Why use a Local or Global or Shared Variable or Property Node when a simple wire will do the trick?...  Many people (from text based background) think it is necesary to create a "variable" when writing code in LabVIEW.  We, of course, know that it is not necessary.  🙂

0 Kudos
Message 341 of 396
(7,865 Views)

I always like to overexagerate 🙂

Other things I've seen before are even worse..

 

Instead of local variables  I saw some even use network published shared variables, OPC servers or (last but not least) File I/O... 🙂

 

Kind Regards,
Thierry C - CLA, CTA - Senior R&D Engineer (Former Support Engineer) - National Instruments
If someone helped you, let them know. Mark as solved and/or give a kudo. 😉
0 Kudos
Message 342 of 396
(7,857 Views)

wow...  I thought I had seen it all.,. File IO???   wow  😮

0 Kudos
Message 343 of 396
(7,839 Views)

Another abuse causing a race condition.. seen here...

 

Below is a portion of the code..  More abuse not shown..

 

 

 

 

Message 344 of 396
(7,836 Views)

1!.PNG

Lets "Go Madden" On that.

"Theres the PSD(prepare Shut Down) Enqueued" but Event element blows the call... but theres the dequeue right there just missing the handoff with event queue again.  Look at the machine GO Event element is really knocking states around down there and trigger stop gets right into the action.  Looks like PSD gets another swat at carrying it to the queue.  Whats that  the event loop exit came out of nowhere and just destoyed the queue! there variable everywhere piled deep on the field.  The refs will never get this straightened out.

 

Smiley Very Happy


"Should be" isn't "Is" -Jay
Message 345 of 396
(7,825 Views)

Listen to this music while reading his text.. 🙂

Kind Regards,
Thierry C - CLA, CTA - Senior R&D Engineer (Former Support Engineer) - National Instruments
If someone helped you, let them know. Mark as solved and/or give a kudo. 😉
0 Kudos
Message 346 of 396
(7,823 Views)

The First attempt at a solution???

pick another local variable to abuse

1a.png


"Should be" isn't "Is" -Jay
0 Kudos
Message 347 of 396
(7,819 Views)

O-M-G  😮

0 Kudos
Message 348 of 396
(7,811 Views)

Scary thing is that everything apparently worked before updating to 64bit windows .... These race conditions can lurk unseen.! 😞

0 Kudos
Message 349 of 396
(7,804 Views)

very scary indeed...

0 Kudos
Message 350 of 396
(7,800 Views)