NI Home
Cart Cart | Help
Hello Events Academic NI Developer Zone Support Solutions Products & Services Contact NI MyNI
You are here: 
NI Home > NI Developer Zone > NI Discussion Forums


Reply
Member
djdewitt
Posts: 7
0 Kudos

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?
Trusted Enthusiast
RayFarmer
Posts: 4,648
0 Kudos

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

Hi,

 

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

 

 

Regards

Ray Farmer

Regards
Ray Farmer
Member
djdewitt
Posts: 7
0 Kudos

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

Does TestStand 4.2 address this feature?
Active Participant
Scott_Richardson
Posts: 837
0 Kudos

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

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
National Instruments
Member
djdewitt
Posts: 7
0 Kudos

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

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.

Trusted Enthusiast
RayFarmer
Posts: 4,648
0 Kudos

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

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
By using this web site, you accept the Terms of Use for this web site. Please read these Terms of Use carefully before using any part of this site. Please go here for information on ni.com's copyright infringement policy.
My Profile | Privacy | Legal | Contact NI © 2011 National Instruments Corporation. All rights reserved.    |    E-Mail this Page E-Mail this Page