NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Optional sequence decision method

 


I am not well versed in TS flow control. I have a TS sequence that, for instance, has 10 steps. If the UUT has a certain part number and rev it should skip steps 3-5. Right now model number 

123-3 should skip steps 3-5,

123-1, 123-2, 123-4, and 123-5 should run all steps.
In this case it would be easy, if model != 123-3 then execute 3-5.

However the plot thickens, as models are upgraded they can skip the steps 3-5. For instance, when model 123-1 rev letter is greater than 'C', or model 123-4 rev letter is greater than B they get to skip the middle steps.

I could put a list of those model that need to run the middle step in a list and read it in via Property Loader, but that would be clumsy as I would need to list all the rev letter versions of each model. Perhaps it would be better to call a VI and give it a model number and let it return yay or nay.
But I am hoping there is some elegant or semi-elegant method in TS that is not obvious to the likes of me. Sure would appreciate your thoughts and suggestions.

Thanks,
jvh 


 

0 Kudos
Message 1 of 14
(4,251 Views)

Is it always e.g. steps 3-5 which must be skipped? You could write a blacklist property file and load that, then iterate through the list comparing the current UUT's model/revision string to the blacklist. Use that outcome to set a local and use the local as the precondition for the steps you're blacklisting for.

Message 2 of 14
(4,241 Views)

Yes, it is always the same group of steps skipped.

0 Kudos
Message 3 of 14
(4,228 Views)

whether you use the property loader or some other means of loading a file of data, you are going to need some list of models with a data indicating whether steps 3-5 are performed or not, probably a boolean which you use as the precondition to perform steps 3-5. I dont think its wise to hard code your list into your sequencefile as it seems that this data could change.

 

with propertyloader you can set to load an array eg {{123-1, false},{123-2,false},{123-3, true}} into an empty local array at runtime which you can scn through until you find a match and use the boolean as the precondition.

 

 

Regards
Ray Farmer
Message 4 of 14
(4,223 Views)

I think it would be better to do in LV.

 

So basically you have a situation where you will have to periodically add PNs to a list that will in turn deny those steps from executing.  The thing I love about TestStand is that there are a 1,000 or more ways to a viable solution.  The problem with TestStand is that there are a 1,000 or more ways to a viable solution. 🙂

 

From what I understand in your situation though it's a pretty simple idea:

1. Check the list of PNs

2. Set a flag if PN is in list

3. Use that flag in the precondition of those steps to eliminate them from executing

 

Am I correct?

 

The problem is you have too many cases where you may or may not want to include or exclude greater than Rev numbers.  Will it only be for the Rev letter or will the - number also be a greater than case?  What I mean is if anything greater than 123-4 Rev B is in your list than would that mean 123-5 Rev A get's excluded?  Because that would even be more tricky.

 

I built a little solution on how I would do it.  I would make your list an external file.  That way you will not have to re-deploy just to add a PN to it.

 

jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
Message 5 of 14
(4,222 Views)

Dang!!! was creating my solution while the others were replying.  Didn't see their responses.

jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
0 Kudos
Message 6 of 14
(4,221 Views)

 


@Ray Farmer wrote:

whether you use the property loader or some other means of loading a file of data, you are going to need some list of models with a data indicating whether steps 3-5 are performed or not, probably a boolean which you use as the precondition to perform steps 3-5. I dont think its wise to hard code your list into your sequencefile as it seems that this data could change.

 

with propertyloader you can set to load an array eg {{123-1, false},{123-2,false},{123-3, true}} into an empty local array at runtime which you can scn through until you find a match and use the boolean as the precondition.

 

 


 

Perhaps I could just test the fact that a model is in the table. I should have said that there is a fixed number of models that require the test, but the list of one that don't will grow. For instance, models 123-1 rev A and 123-1 rev B require the test but 123-1 rev C will not. That is, the newer models will not need the 3-5 test group. So perhaps my array will have:

{{123-1, A}, {123-1, B}, ...}.

 

Next question: Is there a TestStand function for searching array elements or do I need to use ForEach?

0 Kudos
Message 7 of 14
(4,219 Views)

 


@~jiggawax~ wrote:

I think it would be better to do in LV.

 

So basically you have a situation where you will have to periodically add PNs to a list that will in turn deny those steps from executing.  The thing I love about TestStand is that there are a 1,000 or more ways to a viable solution.  The problem with TestStand is that there are a 1,000 or more ways to a viable solution. 🙂

 

From what I understand in your situation though it's a pretty simple idea:

1. Check the list of PNs

2. Set a flag if PN is in list

3. Use that flag in the precondition of those steps to eliminate them from executing

 

Am I correct?

 

The problem is you have too many cases where you may or may not want to include or exclude greater than Rev numbers.  Will it only be for the Rev letter or will the - number also be a greater than case?  What I mean is if anything greater than 123-4 Rev B is in your list than would that mean 123-5 Rev A get's excluded?  Because that would even be more tricky.

 

I built a little solution on how I would do it.  I would make your list an external file.  That way you will not have to re-deploy just to add a PN to it.

 


 

There are 2 models, 123-2, and 123-5 that are at rev -. So when 123-2 rev A and 123-5 rev A come out they will skip the test. Regarding 123-4 rev B, it does not affect 123-5 rev A. My example would have been better if I had used model number like 123-1, DOG-4, and CAT-2; thus perhaps more clearly showing model independence.

 

Thanks for the example. I will try to absorb it now.

 

jvh 

0 Kudos
Message 8 of 14
(4,217 Views)

@"Next question: Is there a TestStand function for searching array elements or do I need to use ForEach?"

 

You can loop on a statement step.  That's generally what I do if I need to access each element in the array.  Or pass it to a code module and have the code module do the work for you.

 

I've seen sequences with over 1,000 steps in them.  I think that too many people try to use TestStand as a programming language and don't utilize code modules enough.

 

The problem in your case of a straight search is that like you said earlier.... You will have to account for every Rev that is beyond a certain point.  That way you won't have to add every single rev in your file or list of PNs.

 

In my example I incorporated the ability to set a rev and allow it to be a greater than rev. If you look in the file you will see a line that starts with "> "  This means that anything matching that PN and has a rev greater than or equal to the rev on that line then make it so thos PNs skip the steps too.  The file can be added to or deleted from.

jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
0 Kudos
Message 9 of 14
(4,198 Views)

 


@jvh75021 wrote:

 

 

Next question: Is there a TestStand function for searching array elements or do I need to use ForEach?


If you create an array of containers and make the names of the containers your model number strings, then you can effectively check if something is in the array by doing:

 

PropertyExists("Locals.ModelsToExclude[\"" + Locals.CurrentModelName + "\"]")

 

If your module names can have special characters like quotes or backslashes in them, you will need to do this instead (or you can just do this anyway just incase):

 

PropertyExists("Locals.ModelsToExclude[" + RunState.Engine.Utility.Escape(Locals.CurrentModelName, EscapingOption_SurroundedByQuotes) + "]")

 

Hope this helps,

-Doug

Message 10 of 14
(4,176 Views)