NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Read command line arguments with an ActiveX step

Solved!
Go to solution

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.

 

 

0 Kudos
Message 1 of 6
(3,866 Views)

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 - CLA, CTA - Senior R&D Engineer (Former Support Engineer) - National Instruments
If someone helped you, let them know. Mark as solved and/or give a kudo. 😉
0 Kudos
Message 2 of 6
(3,821 Views)

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.

0 Kudos
Message 3 of 6
(3,818 Views)
Solution
Accepted by topic author Paulus56

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

Message 4 of 6
(3,777 Views)

Thanks for the solution. This works.

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

Hello Bas,

 

Thanks for helping during my absence (giving courses)!

 

I'll give you a kudo too.. 😉

Kind Regards,
Thierry C - CLA, CTA - Senior R&D Engineer (Former Support Engineer) - National Instruments
If someone helped you, let them know. Mark as solved and/or give a kudo. 😉
0 Kudos
Message 6 of 6
(3,760 Views)