NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Using the Array SetElements function

Hello fellow users.  I have searched the forums for a solution but haven't found exactly what I am looking for.  I have a sequence file with many steps and it has been in use for several years without issue.  I am now going to modify this sequence to run on a sampling plan with a lot size of 18 UUTs.  The sampling plan specifies that the first 3 UUTs must be tested at 100% and pass in order that the remaining 15 can skip certain tests.  In order to keep track of the final test result of the first 3 UUTs, I am attempting to use an initialized array with 18 string elements.  I have a second numeric variable which is incremented at the end of each sequence basically to act as a counter of the UUT number and is reset to 0 when 18 is reached.  Each time a UUT has completed testing, I would like to write PASS into the element indexed by the counter.

 

It appears that the SetElements(Array array, PropertyObject value, [String range]) to accomplish this, but it doesn't change the array in any way.  I would like to have the optional [String range] to be the counter value.

 

What am I doing wrong and is there a better way to accomplish this task?

 

Thank you for your time

Brian

0 Kudos
Message 1 of 4
(3,095 Views)

Hi Bushman,

 

I don't think you are using the correct inputs for SetElements. Here is the help on the function:

 

SetElements Function

 

You can't set one value to the [String range], you will need to pass in a range.

 

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

Hi sherlockholm,

 

Thank you for the reply.  Actually, you can set a single value to [String range] and this worked exactly as described.  What I was attempting to do however, was to pass in the variable name of the counter within the brackets in hopes of obtaining the counter value.  I am quite familiar with the help topic on the SetElements() function.

 

In any event, I ended up using SetValVariantByOffset() which solved the problem.

 

Brian

Message 3 of 4
(3,054 Views)

Brian,

 

Oh gotcha. Thanks for correcting me, and also thanks for how to accomplish this.

0 Kudos
Message 4 of 4
(3,050 Views)