When Sorting ResultList in Teststand, I Get Error -17321: Variable or Property Types Do Not Match or Are Not Compatible.

Updated Jul 31, 2018

Reported In

Software

  • TestStand

Issue Details

I have a TestStand sequence that calls into two sub-sequences. I am using the code below to swap ResultList index 0 and index 1. 

Locals.ResultListTemp=Locals.ResultList, 
Locals.ResultList[0] = Locals.ResultsTemp[1],
Locals.ResultList[1] = Locals.ResultsTemp[0]


When both sub-sequences pass or both sub-sequences fail, the swap works fine. When one sub-sequence fails and the other passes, I get the error below.

Error -17321.
Variable or Property types do not match or are not compatible. 


Why am I getting this error and how can I resolve it?

Solution

Why am I getting error -17321?

You are getting this error when trying to swap Locals.ResultList[0] and Locals.ResultList[1] when one sub-sequence passes and one sub-sequence fails because TestStand adds the property, TS.StepCausedSequenceFailure, only when a step in the sub-sequence fails. The addition of the Boolean variable, TS.StepCausedSequenceFailure, for failed sub-sequences causes the type mismatch error since this Boolean is not present in ResultList for sub-sequences that passed. 

How can I resolve error -17321?

You can resolve the mismatch error by implement one of the two solutions listed below before trying to swap.
  1. Insert TS.StepCausedSequenceFailure for sequences that passed.
  2. Remove TS.StepCausedSequenceFailure from ResultList for sequences that failed.

Here's an example of how you can implement solution one:

WAS THIS ARTICLE HELPFUL?

Not Helpful