NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to access PostStep callback from a dynamically created runtime copy of a sequence

Solved!
Go to solution

I am designing a sequence with a requirement wherein I would have to jump between different tests/steps during runtime based on a jump request from the tester, I had previously divided and grouped all my tests into various sequence calls. To satisfy the above requirement I thought if I had all the tests\steps under one sequence (let's call it TEST sequence) it would be easy for me to implement a logic to jump and skip steps dynalically (I have implemented my jumping logic in my PostStep callback). So instead of having many sequence calls in my main sequence, I left had only one sequence call to my TEST and copied the steps dynamically into TEST similar to what is discused in Insert steps into runtime sequence using DefaultSequenceValues, I got the sequence how I wanted, but for some reason my post step callback did not work within that sequence only. It worked fine everywhere else.

 

Instead of creating a runtime copy, I tried creating a new sequence file and copied my post step callback there, and it worked flawlessly there. My question is therefore, whether a dynamically created (run time copy only instead of creating another file) sequence can access callbacks? Am I missing something? cause it would be better if no additional file gets created.

Lakshmi Narasimha
0 Kudos
Message 1 of 6
(3,072 Views)

I'm not quite sure I'm drawing the right picture in my head.

 

A PostStep substep only applies to steps within the sequence file it resides.  If TEST is in another sequence file you need to add a PostStep to that file.  Even if it is a dynamic sequence file.  It's not clear to me from you description if TEST is in a new file or not.  Do you have a simple example?  How does the user select which one to jump to?  From the UI?  When you say sequence in your description it's not clear whether you mean sequence file or sequence.

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

Hi jigg

 

Here is a sample sequence of what I was actually trying to do. I have a UI to monitor for these jump requests, so here I have a message pop-up to ask the user for a jump request in the example below to simulate the environment

(Note: in the actual program, It does'nt ask for confirmation to skip at the end of execution of each step. I monitor a button click event to detect a jump request and provide a pop-up to get further information. If there is a request, the program skips to that perticular step at the end of the executionm of the current step)

So instead of copying the steps of sequences to TEST in the same sequence file (Yeah, I got confused between sequence and sequence files when I read my question again), I copied them to a different sequence file (TEST is in another sequence, so I did copy all my callbacks to the new sequence) where I got the functionality of what I wanted my sequence to perform.

 

On a side note, if I update the Runstate.Caller.Runstate.NextStepIndex in the preStep callback, it executes the current step before executing the required step. Any workarounds to get the desired solution i.e. executing the required step right after PreStep callback? Should I meddle with the process model to achieve this?

 

 

 

Lakshmi Narasimha
0 Kudos
Message 3 of 6
(3,017 Views)
Solution
Accepted by topic author Lnsimha93

I think this might be what you are trying for.  Check it out and let me know if you have any questions.  I think the key was setting the stepgroup as well as the next step index.

 

Hope this helps,

jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
Message 4 of 6
(2,998 Views)

Thank you. Exactly what I wanted, but I did'nt understand as to why we need to set the StepGroup as well.

Lakshmi Narasimha
0 Kudos
Message 5 of 6
(2,993 Views)

The step group needs to be set so that when the engine resumes execution it knows which step group it was executing in.  The reason you weren't getting out of cleanup is because the engine thought you wanted some index in cleanup.

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