11-07-2012 10:27 AM
I have a programmer that I need to launch in my cvi code. I tried the system command and lauchexecutable command but cannot get the programmer to lauch correctly. If I run it from the command prompt or create a windows shortcut it works fine. Here is the shortcut I created:
C:\TPD\SAVS20P3\asix\up\up.exe /e c:\tpd\savs20p3\q33.hex/erase /q /p
I'm trying to run the up.exe software with /e c:\tpd\v20_hex\v20.hex /erase /q /p as the command line paramters.
I tried the following code which created the above path with command line
strcpy(filename,"C:\\tpd\\savs20p3\\asix\\up\\up.exe /e c:\\tpd\\savs20p3\\hex_ee\\"); ///e c:\\tpd\\savs20p3\\hex_ee\\"");
strcat(filename, hfile);//hex file name will change dynamically
strcat(filename, "/q /p");
I then tried LaunchExecutable(filename) and system(filename). The system functions gives an error. Its trying to lauch the /e c:\tpd\v20_hex\v20.hex file
any suggestions. I beieve its a simple syntax error.
11-07-2012 11:00 AM
Well, apart evident typos in the code you posted, which is not creating the command line you stated, I can only think that before "/q" you should add a space to separate the option from the filename.
This code should create the correct command line:
strcpy (hfile, "c:\\tpd\\v20_hex\\v20.hex"); strcpy (filename, "C:\\tpd\\savs20p3\\asix\\up\\up.exe /e "); strcat (filename, hfile); strcat (filename, " /erase /q /p");