NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

How to count particular executed step in a sequence

Solved!
Go to solution

Hi,

 Thanks in advance. I have a sequence file with multiple operations and i want to count a particular step which is executed in that sequence.

 

Find the attached image below, there is a step highlighted in the sequence want to count that particular step (Like how many times it has been executed)?

0 Kudos
Message 1 of 9
(4,139 Views)

Hi,

 

I assume you're going to be looping your sequence based on a condition and this is why you want to count it?

 

The easiest implementation would be to use a post expression to increment a variable every time it runs (Locals.Count++).

 

You can then output this in any method you like.

 

Nico

--------
Nico
Systems Engineer

Certified TestStand Architect Certified LabVIEW Architect

Message 2 of 9
(4,114 Views)

Hi Nico,

 Thanks for the reply for each step i can't able to add post expression like you said. I am expecting to count a test action step in sequence. Like how many times this particular step had run.

0 Kudos
Message 3 of 9
(4,085 Views)

From the information posted it sounds to me that the solution suggested by Nico is the way to go.   Diana_Mary can you give us some more information why Nico's solution doesn't work for you?  I notice that the steps in your sequence already all have Post Expressions assigned, are you aware that you can have multiple expressions in a single Post Expression by separating them with commas?

 

Locals.Var1++, Locals.Var2 = Locals.Var1 + Locals.Var3

0 Kudos
Message 4 of 9
(4,077 Views)

Hi SercoSteveB,

 Please find the attached file. In that file i have been highlighted the write and read action steps within the loop. Example that loop is running for 10 times, which the action steps has been run multiple times within the loop. So i want to count how many times the write and read steps are executed within that loop i.e., Like a counter says result is 20 times.

 

there is no post expression in this steps. Kindly forgive me that i have not quoted clear example.

 

Thanks,

Diana Mary.

0 Kudos
Message 5 of 9
(4,068 Views)

Hi Diana Mary.  Looking at your screen shot it looks like both the Read and Write steps will always be run exactly 10 times each as the only exit criteria specified within your FOR Loop definition is when Locals.Count >= 10. 

 

Assuming you have other FOR Loop exit criteria that are not included in your example, I would still go with what Nico011 suggested. 

 

These are the steps I would follow to configure the sequence to record the number of times either the Read or Write action was run.

 

  1. Create a variable (e.g. Locals.ReadWriteCount)
  2. Initialise your variable in the sequence (before you use it), Locals.ReadWriteCount = 0.
  3. Add identical post expressions to both the Read and Write Action steps, Locals.ReadWriteCount++.

At any point in your loop (and after) Locals.ReadWriteCount will contain the number of times either the Read or Write Action steps was run. 

 

I am conscious that I am giving you the same answer as before.  Apologies if I have missed something (again).  If I have missed something may I suggest you describe why the Post Expression based solution will not work for you.

 

 

0 Kudos
Message 6 of 9
(4,060 Views)

I created a sequence (.seq attached TS2014), here is a screen capture.

 

ReadWriteCapture.PNG

0 Kudos
Message 7 of 9
(4,057 Views)

Hi SercoSteve,

 

 Thanks a lot. I am using Teststand 2013 so please can you degrade and send me the file. Also need separate count for write and read steps.

 

 

Thanks,

Diana Mary.

0 Kudos
Message 8 of 9
(4,051 Views)
Solution
Accepted by Diana_Mary

Modified for individual tracking of Read and Write actions.  TS2013 version attached.

 

ReadWriteCapture V2.PNG

Message 9 of 9
(4,049 Views)