NI TestStand

Showing results for 
Search instead for 
Did you mean: 

TestStand API Step Insertion - Sequence Module is Missing

Go to solution
I am building a custom sequence editor using TestStand's API. I want to insert custom steps programmatically using LabVIEW. Currently it's done so by first creating them using NewStep method and then inserting.
Problem I'm facing is that if the step is inserted in the way described above, the default module is missing (see screenshot1.png attached).
The same behaviour is not observed if default TestStand Run-time Shortcut Menu is used to insert it (see screenshot2.png and screenshot3.png).
To illustrate this in a direct example, here's the "TestStand User Interface" example shipping with TestStand that is modified slightly (see below). To reproduce the issue using the example code follow these steps:
  1. Open "Build Script.lvproj"
  2. Run ""
  3. Right-click on the sequence editor pane and go to "Insert Step >> CustomSequence".
  4. Observe that the new custom step contains the default module info (Right-click on step >> Specify Module...)
  5. Now Click on the red "Insert" button above sequence pane that should produce exact same output as before, but programmatically. 
  6. Observe that the programmatically-created step does not contain default module information.

What I'm after is a way of inserting a custom step that is based on a sequence adapter with module information embedded in it automatically.

Any ideas whether this is doable (my intuition says that if TS native UI can do it then there must be a way) and if so, how?


Many thanks,


0 Kudos
Message 1 of 4
Accepted by topic author MarkJLR

When you call the NewStep method, you must let the adapterKeyNameVal empty. So this method use the default adapter of the step type (as you want).


If you enter the string 'Sequence Adapter', the newStep method use the adapter of sequence call, which have no file pathname, no parameter ...



0 Kudos
Message 2 of 4
Accepted by topic author MarkJLR

If you're curious about what's different than the context menu and your button, the context menu is probably using CommandKind_Edit_InsertSteps_Set.


If you replace your button with one of the TestStand ActiveX buttons, you should be able to connect it like with the other SequenceFileViewMgr controls and get the same behavior:



Since you're doing this level of customization, you may find this example useful:

Adding a Custom Context Menu to the LabVIEW Full Featured TestStand Operator Interface


This is handy if you want to limit what kind of control your end users have. If you're more interested in scripting sequence file generation instead of OI customization, there is a shipping example for that in the %TestStandPublic% directory.


Hope this helps!

0 Kudos
Message 3 of 4

Thanks Laurent, really didn't expect the solution to be so simple!


Also appreciate the additional info Trent, it definitely will come-in handy.


0 Kudos
Message 4 of 4