LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Control values from references

Is there a more elegant way to do this?

JDMarihew_0-1765217970763.png

 

0 Kudos
Message 1 of 15
(318 Views)

Yes, they're in an array to begin with, so just use a FOR loop followed by the Boolean array AND function on the output.

 

However, this is a weird thing to do, and feels like you're asking how to do something better that you shouldn't be doing in the first place.  Maybe if you clarify your overall goal we can suggest the best option going forward.

0 Kudos
Message 2 of 15
(316 Views)

Nevermind.  Bad question.  The datatype is actually DBL and the binary values come from checking for non-zero numerics.

JDMarihew_0-1765219005839.png

 

0 Kudos
Message 3 of 15
(306 Views)

Hi JD,

 


@JDMarihew wrote:

Nevermind.  Bad question. 


Still you duplicate a lot of code instead of using an autoindexing FOR loop…

(You might even stop the loop on the first FALSE result!)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 15
(281 Views)

Another option would be to just get the cluster data (from the reference if necessary) and then use Unbundle By Name to get your values out.



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
0 Kudos
Message 5 of 15
(262 Views)

If you are using all of the values in the cluster (ie your cluster only has the 4 numeric values), just get the cluster value and use Cluster To Array. You can then run the resulting array into a FOR loop or possibly even do it all without a loop (the >0 will work on an array, then use AND Array Elements).



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
0 Kudos
Message 6 of 15
(258 Views)

This is my current version

JDMarihew_0-1765223778069.png

Just checking to make sure that all 4 limit values have been set.

0 Kudos
Message 7 of 15
(256 Views)

You do not need any loops to answer the questions (of either an Array of Booleans or a Cluster of Booleans).

  • Find the function on the Cluster palette that will turn the Cluster of Booleans into an Array of Booleans.
  • Find the function on the Boolean palette that will return True if at least one Array element is True.
  • Find the function on the Boolean palette that will return True if all the Array elements are True.

No loops.  One (for Arrays) or two (for Clusters) functions on the Boolean (+ Cluster) palettes gets you the answer as a Boolean.

 

Bob Schor

0 Kudos
Message 8 of 15
(249 Views)

@JDMarihew wrote:

This is my current version

JDMarihew_0-1765223778069.png

Just checking to make sure that all 4 limit values have been set.


With this setup, you actually do not need to autoindex the output tunnel nor the AND Array Elements. You just need to wire out the last value of the comparison. This is because you stop the loop when you get a false (fail). If the last one you checked passed, then we know all of them passed.



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 9 of 15
(215 Views)

Hi JD,

 


@JDMarihew wrote:

This is my current version

JDMarihew_0-1765223778069.png

Just checking to make sure that all 4 limit values have been set.


Additionally you don't need to wire the constant "4" as you want to autoindex ALL the control references!

And you can get rid of the NOT when you switch the loop condition to "continue on TRUE"…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 10 of 15
(198 Views)