I want to open an executable file via Codesys (3.5 SP13). I installed the SysOS23 library (3.5.13.0) in my Codesys ControlWin program. I have tried all the instructions available in this library, and all instructions open the program, but without opening the program window. That is, only in Task Manager you can see that the program has been opened.
I tried to open the .EXE file using the "ExecutePlcProgram" in a Button, but it had the same behaviour.
I tried to embed the EXE file in the program without success too.
How do I make the application window to open?
PROGRAM POU
VAR
CRODA: BOOL;
Result: DINT;
Teste2: UDINT;
Resultado: POINTER TO UDINT;
END_VAR
IF CRODA THEN
Result := (pszCommand:= 'C:\Windows\Notepad.exe');
Teste2 := (pszComand:= 'C:\Windows\Notepad.exe', pResult:= Resultado);
SysCreateProcess(pszCommandLine:= 'C:\Windows\Notepad.exe', bHide:= FALSE);
SysCreateProcess(pszCommandLine:= 'C:\Windows\Notepad.exe', bHide:= TRUE);
CRODA := FALSE;
END_IF
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
If you want to show a program window, you first have to check which is the user starting the program. Because the interface you see here, is for a user and only this one. Althougt that a user may not have an interface at all (system accounts for instance).
So I would look at how to start your program with the proper user first.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I want to open an executable file via Codesys (3.5 SP13). I installed the SysOS23 library (3.5.13.0) in my Codesys ControlWin program. I have tried all the instructions available in this library, and all instructions open the program, but without opening the program window. That is, only in Task Manager you can see that the program has been opened.
I tried to open the .EXE file using the "ExecutePlcProgram" in a Button, but it had the same behaviour.
I tried to embed the EXE file in the program without success too.
How do I make the application window to open?
PROGRAM POU
VAR
CRODA: BOOL;
Result: DINT;
Teste2: UDINT;
Resultado: POINTER TO UDINT;
END_VAR
IF CRODA THEN
Result := (pszCommand:= 'C:\Windows\Notepad.exe');
Teste2 := (pszComand:= 'C:\Windows\Notepad.exe', pResult:= Resultado);
SysCreateProcess(pszCommandLine:= 'C:\Windows\Notepad.exe', bHide:= FALSE);
SysCreateProcess(pszCommandLine:= 'C:\Windows\Notepad.exe', bHide:= TRUE);
CRODA := FALSE;
END_IF
Did you solve this problem?
I have too now
If you want to show a program window, you first have to check which is the user starting the program. Because the interface you see here, is for a user and only this one. Althougt that a user may not have an interface at all (system accounts for instance).
So I would look at how to start your program with the proper user first.
Thanks for your replay, but I'm sorry I didn't understand.
My windows user name is Administrator.
My codesys user has to be Administrator too?
Thanks for your replay, but I'm sorry I didn't understand.
My windows user name is Administrator.
My codesys user has to be Administrator too?
Did you solve this problem?
I have too now
Have you solved this ?