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
Paulus56
Posts: 5
0 Kudos
Accepted Solution

Read command line arguments with an ActiveX step

Hi

 

I would like to read the command line parameters from TestStand startup. I did find an ActiveX resulting in a Object Reference (See Locals.CommandsRef). How do I use this reference to really get the arguments and their count? See also screenshot.

 

 

Active Participant
ThiCop
Posts: 1,657
0 Kudos

Re: Read command line arguments with an ActiveX step

Hello Paulus,

 

It's possible to access command line arguments in the following (pseudo-code) way:

 

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

 

Do you want to use it with the actual TestStand Startup or rather with the start-up of a sequence file?

Kind Regards,

Thierry C - Platinum Applications Engineer - NI Belgium
CLD

If someone helped you, let them know. Mark as solved and/or give a kudo. :smileywink:
Member
Paulus56
Posts: 5
0 Kudos

Re: Read command line arguments with an ActiveX step

Hoi Thierry,

 

Thanks for the help. To start with the easyiest part: I would like to know the arguments of the starting sequence file.

 

Ik saw this pseudocode before but don't know what to do with it. I would like to read the arguments in TestStand. Where do I put this pseudocode? It makes no sense putting it in a TS-statement.

 

I tried to use ActiveX as seen in the sscreenshot. Is that a wrong direction? If correct, how should I go on with this Object reference.

Active Participant
BasvanDijke
Posts: 1,205

Re: Read command line arguments with an ActiveX step

Hi Paulus,

 

Via this link, you find an forumthread that describes the same issue. testStand does not support this, but there is a workaround. Attached you find the code.

 

The attachment includes a LV vi with the command line. If you doen't use Labview, here is the command line:

C:\Program Files (x86)\National Instruments\TestStand 2012\Bin\SeqEdit.exe /goto "Parameter1 = test" /runEntryPoint "Test UUTs" D:\Testsequence.seq

 

Regards,

Bas

Member
Paulus56
Posts: 5
0 Kudos

Re: Read command line arguments with an ActiveX step

Thanks for the solution. This works.

Active Participant
ThiCop
Posts: 1,657
0 Kudos

Re: Read command line arguments with an ActiveX step

Hello Bas,

 

Thanks for helping during my absence (giving courses)!

 

I'll give you a kudo too.. :smileywink:

Kind Regards,

Thierry C - Platinum Applications Engineer - NI Belgium
CLD

If someone helped you, let them know. Mark as solved and/or give a kudo. :smileywink:
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