06-04-2018 03:50 AM - edited 06-04-2018 03:51 AM
Hi All,
In my process of learnig labVIEW ,I am currently working through the German Course material section Clusters,
Which is fine for me however the Professor's who wrote the book labVIEW 2 Bernd vom Berg & Peter Groppe
shows that a person can improve the viability of a Vi by removing the datastream between the input and out put clusters by using a local variable .
My concern is by the help of the forum members on my fisrt application it was mentioned that local variable should be used with care ,
My question what is the experienced peoples view on the use of a local variable and clusters ?
Input /Output Cluster
Block Diagram with local variable used
All comments are appreciated
Regards
QMESAR
Solved! Go to Solution.
06-04-2018 06:17 AM
If you need too much local variables, you need a redesign.
They are often unavoidable however (although you can use a value property node, but that could be even worse).
Use locals to update controls\indicators at multiple places. Not for other things, like data communication, data synchronization, data storage or data buffering.
And realize that each local keeps a copy of the data in memory. Not that bad for clusters, but can be bad for large arrays.
06-04-2018 06:44 AM
Hi QMESAR,
In my personal experience, I wouldn't recommend usage of the local variables as it causes Race Condition. Anyway if you want to know more about Local Variables, Refer it here where someone already asked the similar question....
https://forums.ni.com/t5/LabVIEW/How-do-you-use-local-variables/td-p/3305477
06-04-2018 06:54 AM
Hi All,
Thank you for the information and your comments,
and the link !
Regards
QMESAR
06-04-2018 07:19 AM
BTW Not sure, but if that book is about LabVIEW 2, it might be a bit out of date (20 years or so)!
The language got soo much richer since. The basics of data flow will still hold, but there are new solutions available that won't be in the book.
06-04-2018 07:43 AM
Hi.
Thank you the book is called labVIEW 2 it is number 2 of a 3 series book set ,written for labVIEW 2014,
I guess there is a few new things in 2015 and higher however the series give a good understanding of the basics
Regards
QMESAR
06-04-2018 09:06 AM
There are situations when that can be used, e.g.in a dialog with Cancel button. If Cancel, wire the original through, else read out a Local variable. In your example the chance is big that you'll get the previous value.
Local variables is a tool that can be used, but more often than not, it's abused.
/Y
06-04-2018 09:27 AM
@QMESAR wrote:
Thank you the book is called labVIEW 2 it is number 2 of a 3 series book set ,written for labVIEW 2014,
That sounds far better then a book about LabVIEW 2 (not sure if there are books about LV2).
@QMESAR wrote:I guess there is a few new things in 2015 and higher however the series give a good understanding of the basics
Indeed, not that much new. Guess malleable VI's (>2017sp1) will be quite a game changer. But nothing new that will invalidate the 2014 stuff.
06-04-2018 09:33 AM
The best book I can think of to learn LabVIEW best practices is Peter Blume's LabVIEW Style Book. Although it shows its age here and there, all of what it talks about is still extremely relevant.
06-04-2018 09:58 AM
Thank you very much for all the help and info much appreciated
Regards
QMESAR