NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I execute a DOS console application in TS and how to post parameter to ti?

Hi
 
I have a DOS application which is used to program SN to product,
When I run the application out of TS, 3 actions need to be done, first is to enter the SN then press "Enter", second is to enter the ComCode and then press "Enter",then the app will ask to confirm "Y" or "N".
Now the SN and ComCode is kept in locals, how can I invoke such an app to implement the process and pass all parameter to it.
********************************
*The best Chinese farmer*
********************************
0 Kudos
Message 1 of 3
(3,173 Views)

Hi,

Pass the information via the arguments of the exe file.

eg

c:\MyAppPath\MyApp.exe SN Comcode would be the command line you would use to invoke the exe.

In your application, you would pickup SN and Comcode from the values in argv which is your second parameter to main()

therefore argv[0] = MyApp.exe, argv[1] = SN and argv[2] = Comcode.

The first parameter of main() is the number of element to argv, which for my example would be 3.

Hope this helps

Regards

Ray Farmer

Regards
Ray Farmer
0 Kudos
Message 2 of 3
(3,172 Views)

Hi Farmer

Now I have no environment to implement your idea due to the running product line.

I have got your mean that I shoule transfer parameters as C entry point, main ( argv, argc), am I right?

In fact I do not validate the source code pass SN and ComCode as your mean, because it's the custom's, I do not have source code.

In other words, source code may be use "scanf" to accept the parameter and implement actions, maybe other more method.

Sorry for this is only my thought without no action.

I will execute1 your advice ASAP.

Thanks a lot.

FarmerSmiley Tongue

********************************
*The best Chinese farmer*
********************************
0 Kudos
Message 3 of 3
(3,157 Views)