LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

cluster handling: selectively updating values

Solved!
Go to solution

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 Smiley Sad

cluster handling.PNG

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!

Download All
0 Kudos
Message 1 of 4
(2,617 Views)

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.

0 Kudos
Message 2 of 4
(2,603 Views)
Solution
Accepted by topic author OPCer

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.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 3 of 4
(2,596 Views)

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?

0 Kudos
Message 4 of 4
(2,591 Views)