From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

VI Analyzer Enthusiasts Documents

cancel
Showing results for 
Search instead for 
Did you mean: 

Test - View Cluster Constant as Icon

This test returns a failure for any cluster constant with a default data type value, that is not set to "View Cluster As Icon":

 

clustconst.png

 

If a cluster constant has the default value for its data type, it should be set to "View Cluster As Icon" to save on block diagram space.

 

This test is saved in LabVIEW 2016. Follow the instructions here to install and use this test.

Comments
PrasannaSSRK
Member
Member
on

Hi Darren, I know this is a very old post, but I stumbled upon using this test in one of my VIs and found an issue. Using a "Diagram Disable structure" to get the default value of a variant will not work. 

PrasannaSSRK_0-1705215745554.png

The default value will always be an "Empty Variant" whereas, the default value of a cluster in variant form will be the default value of individual elements in the cluster.

PrasannaSSRK_1-1705216153268.png

PrasannaSSRK_2-1705216184825.png

In order to check the default value of a cluster, which comes as variant, we have to get references of all the individual elements within the cluster, identify its type and get the default value.

I am not sure are there any other best ways to do these. Please share if any

 

Darren
Proven Zealot
Proven Zealot
on

Good catch, I don't know how that code ever worked. 😛 I've published an updated version that creates a dummy constant (with default value) to compare against. This one seems to work.

Untitled.png

Contributors