From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

NI TestStand Idea Exchange

cancel
Showing results for 
Search instead for 
Did you mean: 
vrv

Pre/Post-Execution substep

Status: Declined

I'm declining this idea due to lack of community support.

Hello

 

Execution of a single step is a process executing a lot of steps depending on looping and synchronization. Needing the option to call a PreExecuting and PostExecuting step before taking Looping, PreConditions and Synchronization options in consideration and after all other steps are executed. This is intended to custom step types for use with external customers.

StepExecution.png

StepType-SubSteps.png

 

Thanks Vagn

5 Comments
dug9000
NI Employee (retired)

Please explain your particular use case if possible and why the existing mechanisms are not sufficient.

Thanks,

-Doug

vrv
Member
Member

Sorry for my late reply.

 

Running tests using batch model I would like to measure analog voltages/currents in parallel with NI-DAQ measuring device. NI-DAQ measuring devices cannot handle measuring multiple tasks at the same device in parallel.

SimpleBatchExecution.png 

 

Instead measuring all data in a single task is the procedure.

The problem is which test socket should measure and which test sockets should just fetch data? The obvious answer is: first socket should measure and the rest should fetch.

Next question: How do I know which test socket is the first one? Answer: Use "Batch Synchronization - Serial (one thread at a time)". Answer is not adequate as I don't know which one is the first test socket running the specific step. Below is a couple of things to take in consideration:

1. Lowest test socket runs first.

2. Precondition might disable lowest test socket.

3. Test sockets has finished execution caused test failure (test stops at first failure in our test sequences).

4. "PostResultListEntry" callback is called multiple times if looping (action 23 and 34) in same step

5. "PostResults" callback is called multiple times (action 24 and 35)

6. The step might be in a subsequence called a lot of times why "unique step ID" is not unique.

7. In the test step I can get all Thread Ids in Batch Threads but this information is given at a time before precondition is evaluated.

 

Bottom line - it is difficult to figure out for sure which socket needs to measure.

 

The solution is using 2 steps:

Solution 1:

1. Measuring step with no evaluation (first test socket only including preconditions and ....).

2. Fetch step for all test sockets evaluating measurement.

 

Solution 2:

1. Figuring out which socket is the first socket

2. Measuring and evaluation of measuring.

 

With the proposal of pre/post execution step it would be easy to configure a trigger telling which socket should measure and evaluate, and which sockets who should fetch and evaluate.

dug9000
NI Employee (retired)

I'm not completely clear on why batch synchronization doesn't solve this problem for you, nor on how pre/post execution substeps would. Perhaps more details would help.

 

One thing you might not be aware of is that you can cancel calling the main code module of a step from a presubstep, thus you might already be able to get a behavior similar to what you are asking for. See the API help for Step.CancelCurrentModuleExecution and Step.CancelCurrentExecution for more details.

 

-Doug

vrv
Member
Member

The Pre/Post-Execution substep will give the opportunity to set/initialize a boolean flag to tell the function if current entry into step execution is new (make DAQ) or remaining testsockets running needing to fetch data.

WireWeaver
Active Participant
Status changed to: Declined

I'm declining this idea due to lack of community support.

https://www.linkedin.com/in/trentweaver