NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

create user tools

Hello,

    I have created a sequence file that takes sequence context as a parameter, and exports the local vairables of the calling sequence into an xml file. However, i want to keep this as a utility, just like the generic Import export. When i try to customize the tools menu, there are only four options - sequence,submenu,command and sequence file.
What i need is that, when i open up any sequence, and then click on the "Export to Xml..." on the tools menu, it should show the sequence context of the opened sequence file. When i try to to customise the tools menu, and make a new tools item "Export to XML..." as a sequence call to this sequence that i have designed that takes the sequence context as a parameter input, there is no way of passing this parameter to the sequnce call in this tools option.

   In other words, i want the sequence context of the last opened sequence file to be passed to this new sequece call tool item as a parameter. Could you please help me out with how to acieve this. Is there any other way to design this tool item?

Thanks,
Aparna

0 Kudos
Message 1 of 4
(3,524 Views)
A SequenceContext is typically used to represent what is available to a particular stack frame in an execution or to simulate what might be available at execution time while editing.
 
Instead of a SequenceContext, you really only need the selected sequence file. You can get this from RunState.Root.InitialSelection.SelectedFile.
 
If you really need a SequenceContext, you can get one by passing the selected file to Engine.NewEditContext.
 
 
0 Kudos
Message 2 of 4
(3,516 Views)
Hello James,

  Thank you for the reply, but i did not understand how to use the call. I did not file RunState.Root.InitialSelection in the API calls. Also, in the my external module, i do not know how to get the RunState reference. All i have right now is the SequenceContext of the Export sequence in which i am making a call to this dll. From this, i can do SeqContext.Root.SelectedFile.SequenceContext, but does this give me the last opened file in Teststand editor? I have been trying this, but its giving me an exception if i try to access the Root property of the sequenceContext.
Could you please tell me how to get the last opened file in the editor, either from the external module or the teststand export sequence.

Thanks,
Regards,
Aparna
0 Kudos
Message 3 of 4
(3,477 Views)

Hi Aparna,

We have a shipping exampled located at C:\Program Files\National Instruments\TestStand 3.5\Examples\Tools that demonstrates how to create a tools menu item that edits the selected sequence file.  Most tools use the RunState.InitialSelection subproperty that specifies the set of properties, steps, and sequences, as well as the file or execution that is selected or active when you start a new execution.  Use this subproperty to grab references to step objects, sequence file objects, etc.   

To find help on what the different elements in that subproperty represent, refer to the TestStand Help (Help >> TestStand Help; Then type initialselection in the index tab).

Hope this helps!

Best Regards,

Jonathan N.
National Instruments
Message 4 of 4
(3,460 Views)