NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Pass current sequence as argument in Customize Tool Menu

Solved!
Go to solution

Is it possible to pass the full path and filename as an argument under the Customize Tool Menu?

 

Basically, I have an external tool that works on a sequence file and I'd like to call it from the Tools menu.  It's a Command type but I don't know what to put in the arguments.  I found a post where someone said use "%FILE%", but that did not work. 

 

Also, if there are other keywords available, where is that list?

 

Thanks. 

0 Kudos
Message 1 of 5
(3,933 Views)
Solution
Accepted by topic author Richard.Morgan

Hi Richard,

 

It seems there isn't a way to do this using the Command type.  The problem is that you can't use an expression to specify the arguments for the executable and you need to use an expression to get the current sequence file's path.

 

However,  you can wrap your executable in a sequence file that has only one step; calling your executable.  If you place a Call Executable Step in your sequence, you can specify the argument as the current file path by using the expression RunState.InitialSelection.SelectedFile.Path.

 

Then add a new item to the Tools menu and select your wrapper sequence.

 

Cheers, 

Message 2 of 5
(3,916 Views)

Michael:

 

Thanks very much.  I had thought of going the Sequence route, but I was stumped on finding the selected file path.  RunState.InitialSelection.SelectedFile.Path is beautiful! 

0 Kudos
Message 3 of 5
(3,909 Views)

It doesnt works for me - I am getting an exception: 

 

Error in Argument Expression
Unknown variable or property name 'RunState.InitialSelection.SelectedFile'.

 

-17306; Unknown variable or property name.

 

Step 'Call Executable' of sequence 'MainSequence' in 'seq  test.seq'

 

I have only seq test.seq with call executable step - in arguments :

 

"\"" + RunState.InitialSelection.SelectedFile.Path

0 Kudos
Message 4 of 5
(3,407 Views)

Are you running the sequence from the tool menu? The initial selection might not be set otherwise. Try setting a breakpoint and looking at the variables view window in the execution document to see what variables exist. Make sure you don't have a typo.

 

-Doug

0 Kudos
Message 5 of 5
(3,397 Views)