NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Custom Teststand For-loop doesn't loop

Solved!
Go to solution

As a first step in creating a custom For-loop step type, I copied the standard for-loop from NI_Flow_Control.ini to MyTypes.ini. I renamed the step, changed the Default Step Name expression to a string constant, and did the same with the Item Name Expression. That's it- no other changes. However, the loop doesn't loop. I've compared it wit the standard "For" step with multiple identical loop conditions. The standard For step runs as expected. My not-yet-very-custom step runs exactly once, no matter what I do. What am I missing? Thanks!

0 Kudos
Message 1 of 6
(3,843 Views)
Solution
Accepted by charlie_k

The flow control steps are special. If you examine them, you'll see there are no substeps to define their runtime behavior. The runtime behavior is built-in to the engine as an optimization. The engine applies the runtime behavior based on the step type name. If you copy a NI flow control step and want it to continue to have its default runtime behavior, make sure your step type name begins with the original NI name. For example rename "NI_Flow_For"  to "NI_Flow_For_MySpecialVersion"

Message 2 of 6
(3,835 Views)

Great- thanks! I can still use anything name I want in the menu expression, so it's transparent to a developer.

0 Kudos
Message 3 of 6
(3,831 Views)

I've modified the with an edit substep which sets up the looping parameters. However, there are two additional issues:

1) I've added a post substep that populates the "Report Text" field. However, when my report is generated, the report contains nothing at all with regard to this looping step

2) I would like to hide the default loop condition editor in the step settings pane, as I only want my own configuration routine to be available.

 

Any ideas? Thanks so much for your help!

0 Kudos
Message 4 of 6
(3,825 Views)

I'm not sure from your description what is happening in 1, but for 2, go to your step type in the types view and expand it to NI_Data.EditPanels. Click the Resize Array button for EditPanels and checkmark Empty.  Also checkmark the option to apply the bounds changes to all loaded instances (and make sure any files with your step type that you want to be affected are already loaded).

0 Kudos
Message 5 of 6
(3,814 Views)

For 1) the problem might be that the default for your step type is to not record results. Make sure that the record results checkbox is checked for your step type and step instances.

 

Hope this helps,

-Doug

0 Kudos
Message 6 of 6
(3,809 Views)