NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Check if array contain a value

Solved!
Go to solution

Hello all,

 

I have an array in TestStand that contains some numbers. The numbers are generate by a VI and are randomly ordered.

 

1) How do I check to see if the number "6481" is in that array using a TestStand step?

2) Is it possible to set that array to be empty in TestStand, and then populate the array to the size needed when the VI pass back the numbers. (i.e. make the array grow to the size the VI generates during run time)?

 

Cheers,

Chase

0 Kudos
Message 1 of 5
(7,831 Views)

Hi,

 

1) Locals.MyArray[Locals.Index] == 648, Locals.Indexstarts at 0 ...

 

2) If you start off with the TestStand declared as empty then when pass your array from LabVIEW to TestStand it will populate the TestStand Array automatically.

 

 

Regards
Ray Farmer
0 Kudos
Message 2 of 5
(7,819 Views)

Hi Ray,

Searching in an array is always a topic for me. Most times i iterate through it and check the if desired value is present.

But i am not able to do this in a single step.

 

If using a container array you can assign a name to the index. In my case the name is the value itself.

now you can use PropertyObject.Exits for validating.

 

What do you think about this ?

 

Hi Bladhart,

The example will show the Api-Calls which Ray suggest for doing this.

 

Regards

Juergen

 

 

 

 

--Signature--
Sessions NI-Week 2017 2016
Feedback or kudos are welcome
0 Kudos
Message 3 of 5
(7,799 Views)
Solution
Accepted by topic author Bladhart

I think you will be interested in this Juergen!

 

I did managed to do it in "one step", using a loop.

 

RTDG-RD-11.jpg

RTDG-RD-12.jpg

Message 4 of 5
(7,765 Views)

Hi Bladhart,

 

Thanks for hint,

Till now did not know that there is a custom option for doing loops,

It will solve my issue and it will keep my stuff more simple.

 

Regards

Juergen

 

--Signature--
Sessions NI-Week 2017 2016
Feedback or kudos are welcome
0 Kudos
Message 5 of 5
(7,758 Views)