NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

how to compare 2 arrays with different operator options using parameters in Teststand

Pls let me know how to compare 2 arrays using different operators like <= or >= or ==......

 

 

0 Kudos
Message 1 of 15
(5,464 Views)

I would say that TestStand is probably the wrong place to be doing this kind of function - it would probably be far better to pass your 2 arrays into a LabVIEW sub VI or a C#/C++ method etc depending on what you're using with a control to tell the code module how to compare the two arrays and pass back a boolean to say whether the condition has been met.

 

If you absolutely have to do it in Teststand then you will probably have to iterate through both arrays simultaneously and compare them element by element to get your comparison.

David Clark
CLA | CTA
IDEX Biometrics UK Ltd
Hampshire, England
0 Kudos
Message 2 of 15
(5,434 Views)

hi,

 

Thanks for your reply.

 

Do you have any example in teststand related to my query...

 

thanks

0 Kudos
Message 3 of 15
(5,428 Views)

I've put a really simple sequence together to show how to compare 2 arrays aggregate i.e. all indexes added together, but I'm not sure if that's entirely what you are looking for.

 

The sequence just sets up 2 arrays then iterates through each one adding up the total value and then compares them using the value you entered in the dialogue.


Get back to me to let me know if this helps or not if I'm not understanding your issue correctly.

 

Sequence is in TS 2012.

 

 

David Clark
CLA | CTA
IDEX Biometrics UK Ltd
Hampshire, England
0 Kudos
Message 4 of 15
(5,422 Views)

Thanks for taking your time for this assignment, Since I am using TS 2010 I am not able to open this file.........is it possible to send the seq file in TS 2010 format.....

0 Kudos
Message 5 of 15
(5,420 Views)

 I am using TS 2010. FYI

 

 

ex:

Array XX [ A_Temp,

               B_Temp,

               C_Oil Pressure,

               D_Oilpressure,

               ......

               ......]

 

Note : A_Temp, B_Temp,C_Oil Pressure,D_Oilpressure all these parameters will be getting  numerical values (dynamically) from the simulink models and also in future I may need to add parameters to this array.

 

 

Array YY [A_Temp_1,

               B_Temp_2,

               C_Oil Pressure_3,

               D_Oilpressure_4,

               ......

               ......]

 

Note : A_Temp_1, B_Temp_2,C_Oil Pressure_3,D_Oilpressure_4 all these parameters will be getting  numerical values (dynamically) from the simulink models

 

So my question :

 

I would like to verify A_Temp >= A_Temp_1

                            B_Temp >= B_Temp_2

                            C_Oil Pressure  >= C_Oil Pressure_3  etc

 

 

 

 

 

0 Kudos
Message 6 of 15
(5,418 Views)

Try this.

David Clark
CLA | CTA
IDEX Biometrics UK Ltd
Hampshire, England
0 Kudos
Message 7 of 15
(5,415 Views)

getting error"

 

array comparsion.seq was saved in teststand 4.5.0.310 and is incompatible with TS 4.2.1.83...Error code : - 17098...." FYI

0 Kudos
Message 8 of 15
(5,411 Views)

I am having TS 4.2.1.83

0 Kudos
Message 9 of 15
(5,409 Views)

Use a FOR loop to iterate through the two arrays.  You can use GetArrayElements(XXX) to get the number of elements in an array.  So that goes into the number of iterations to perform.  Create an indexing variable (I'll use i for example purposes).  So then your comparison is simply Array1[i] >= Array2[i].


GCentral
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 10 of 15
(5,404 Views)