05-31-2016 08:59 AM - edited 05-31-2016 09:01 AM
Dear all,
I have a working VI but I am convinced this is not exactly well coded. however i dont know how to do this better.
the task is to overwrite certain values of a cluster of old data with new data, depending on a user input in form of booleans for every value.
dont hurt me for coding this
the background is: these are correction values for a continous stream of data, in oder to dynamically correct offset gauges . this VI is part of a higher level while loop.
thanks for your ideas!
Solved! Go to Solution.
05-31-2016 09:21 AM
Holy! Ok I think we would all benefit from further explanation on what you want to do. I am just taking a wild guess, but I think what you want to to boils down to replacing selected cluster values, while leaving the rest unaltered, which is explained in this NI example.
http://zone.ni.com/reference/en-XX/help/371361J-01/lvhowto/replacing_cluster_elements/
If not, please help us understand you better, I'm intrigued.
05-31-2016 10:26 AM - edited 05-31-2016 10:27 AM
In situations like this, I oftne like to use a FOR loop. Autoindex on an array of strings and use a case structure with the selection terminal wired to the string. Now you can unbundle one thing at a time, decide if you need to update it, and only update it if neccessary. I find this easier to understand and it takes a lot less space.
Note: In the FALSE case, I am just wiring the "current gauging" straight through. So the shift register always holds the latest cluster and we only update as necessary.
05-31-2016 10:30 AM - edited 05-31-2016 10:52 AM
thank you!
that saves 2 screens of Block diagram^^
but unless i misunderstand something, this takes much longer to "code", since you have to wire every case manually - a lot more effort than my version? apart from the block diagram area waste?