NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I process user command line arguments inside of the Sequence Editor?

Using TestStand 4.0, how would I go about storing "extra" command line arguments processed from the /runentrypoint command in the Sequence Editor specifically?
0 Kudos
Message 1 of 6
(3,635 Views)

Hi,

 

You can't, your stuck with whats defined in the Reference Manual.

 

 

Regards

Ray Farmer

Regards
Ray Farmer
Message 2 of 6
(3,629 Views)
Does TestStand 4.2 address this feature?
0 Kudos
Message 3 of 6
(3,627 Views)

djdewitt -

TestStand 4.2 does not have this feature; however, we do have an internal issue (#163169) to track this request. You can actually get the commandline passed to the TestStand Sequence Editor using the below psuedo code in a sequence; however, currently the TestStand Sequence Editor displays a prompt when it does not recognize a custom token on the command-line and there is no way to suppress this.

Locals.AppMgrRef = RunState.Engine.GetInternalOption(InternalOption_ApplicationManager);

Locals.CommandsRef = Locals.AppMgrRef.CommandLineArguments;

Locals.CountNum = Locals.CommandRef.Count;

For i=0 to Locals.CountNum - 1

    Locals.CommandString = Locals.CommandRef.Item(i);

End

One suggestion is to use a batch file to write the commands to a dedicated text file and then launch the sequence editor. You can then use a sequence in the sequence editor to read from the file.

 

Lastly, I just tried something and I do not necessarily recommend this, but I noticed that the Sequence Editor does not prompt when using the /goto token, so if I use the below command-line, it seems that no prompt appears, the goto command does nothing, and the psuedo code accesses the command-line tokens: 

"C:\PathToApp\SeqEdit.exe" /goto "location tokens that do nothing" /run MainSequence "C:\PathToSequenceFile\GetCommandLineArgs.seq"

Keep in mind that NI does not necessarily support this but it does seem to work for now.

Scott Richardson
0 Kudos
Message 4 of 6
(3,604 Views)

I just went ahead and did exactly as you suggested before I even had a chance to read your response and made a batch file that wrote the arguments to a text file which is parsed via a sequence callback in my process model. Your other solution seems pretty interesting though.

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

Hi,

 

Another way might be to develope the Operator Interface which you can launch in editor mode. You should beable to add you own parsing for the command line.

 

Regards

Ray Farmer

Regards
Ray Farmer
0 Kudos
Message 6 of 6
(3,596 Views)