NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Display LV cluster element value as an expression

Solved!
Go to solution

I have a custom step type with a VI that has a cluster as input. I would like to display the value of a particular element of the cluster in the description of the step. I know how to get the value of other data-types with the expression

 

Step.TS.SData.ViCall.Parms["Parameter Name"].ArgVal

 

Since "Parameter Name" will be a cluster in my case, I can't find how to retrieve the value of a element.

0 Kudos
Message 1 of 4
(2,273 Views)
Solution
Accepted by topic author GoKu25

Hey,

 

You can reference the elements in the cluster using the ArrayClusterEls[] property. Your line will look something like this:

 

Step.TS.SData.ViCall.Parms["ClusterName"].ArrayClusterEls[ElementIndex].ArgVal

 

For example, my code module has a cluster argument called Cluster with a numeric and boolean control.

 

The below returns the numeric value (index 0):

Step.TS.SData.ViCall.Parms["Cluster"].ArrayClusterEls[0].ArgVal

 

The below returns the boolean value (index 1):

Step.TS.SData.ViCall.Parms["Cluster"].ArrayClusterEls[1].ArgVal

 

 

Hope this helps.

Nico

 

 

--------
Nico
Systems Engineer

Certified TestStand Architect Certified LabVIEW Architect

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

Thanks Nico,

 

 When I insert the custom step, values are displayed in the description for

1. Enum input

2. Numeric/Boolean/String inside a cluster

 

But the value of an Enum inside a cluster is not visible right away. When I change the Enum value, it appears in the description. Do you maybe know why?

0 Kudos
Message 3 of 4
(2,238 Views)

Hey,

 

Not sure why this might be, sorry. My inkling would be that the property is not updating until you go and open the cluster elements.

 

But that's a guess.

 

Nico

--------
Nico
Systems Engineer

Certified TestStand Architect Certified LabVIEW Architect

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