NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Iterate through arrays in a container in Station Global

Hello,

 

I have a container in Staion Globals named StandardTest and I have 16 arrays in it.

Is there a way that I can iterate through the arrays inside StandardTest, using for example a for loop?

Just to be clear I know how to iterate through the variables inside an array, I don't know how to iterate through

the arrays inside the container. 

I need to write something like this:

 

for (each array in StandardTest)

for(each element inside the array)

//Do Something

end

end

 

Thanks for your help,

Naeemeh

0 Kudos
Message 1 of 2
(3,145 Views)

Naeemeh,

 

you are in fact looking for something like this:

Step.Result.ReportText = Str(Locals.MyCont.GetNthSubProperty("",<itemindex_in_container>,0).GetValNumber("",0))

Please note that this expression is not fail-save!

Additionally, the datatype does not match an array, but is a numeric in this example. So your use-case is a bit more difficult. But i hope this "Little nudge out of the door" is enough for you to find the solution....

 

Norbert

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 2 of 2
(3,134 Views)