I've spent the day reading through the forums to seek a solution to my problem.
Perhaps I have missed something obvious which is why a solution eludes me...
I'm trying to run an executable file through my program POU.
This is what I've done so far.
PS: I made a button to launch the executable through the visualization and that works, so the file and the path are fine. I get no compile errors either and the rest of the program seems to run fine.
I'm working on Windows 7, in a simulation as I do not have access to a device just yet.
Note: The commented solution did not work either.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I hope you read my message! I am in S.O.S situation indeed . .
Actually, I have a big problem may be you can help me :
I am working on Windows 10 x64 and I need to execute a batch file in CodeSyS for some purpose
but SysProcess Execute Command is not working ! I have done these steps carefully:
1 -
CODESYSControl.cfg [SysProcess]
Command=AllowAll [SysFile]
Windows.WorkingDirectory=C:\ProgramData\CODESYS\CODESYSControlWinV3x64\801BFF8C
2 - Create a Py file
3- call Py file in batch file and test the bat.file to be sure if it works fine.
4- Create a POU file in codesys
IF fbTimer1.Q THEN
//Reset it and flash again
counter2 := counter2 +1;
fbTimer1(IN:= FALSE);
Test_2 := SysProcessExecuteCommand(pszComand:= Command , pResult:= ADR(dutResult));
END_IF
Hello Team.
I've spent the day reading through the forums to seek a solution to my problem.
Perhaps I have missed something obvious which is why a solution eludes me...
I'm trying to run an executable file through my program POU.
This is what I've done so far.
AND
PS: I made a button to launch the executable through the visualization and that works, so the file and the path are fine. I get no compile errors either and the rest of the program seems to run fine.
I'm working on Windows 7, in a simulation as I do not have access to a device just yet.
Note: The commented solution did not work either.
Hi,
why not using the installed Control Win runtime?
BR
Edwin
Thank you kindly for your response!
This was the obvious flaw in my program that I failed to understand.
In hindsight it makes perfect sense that to perform commands you
need to be logged into a device....
Everything is working now. Thank you again.
Hi @eschwellinger,
I hope you read my message! I am in S.O.S situation indeed . .
Actually, I have a big problem may be you can help me :
I am working on Windows 10 x64 and I need to execute a batch file in CodeSyS for some purpose
but SysProcess Execute Command is not working ! I have done these steps carefully:
1 -
CODESYSControl.cfg
[SysProcess]
Command=AllowAll
[SysFile]
Windows.WorkingDirectory=C:\ProgramData\CODESYS\CODESYSControlWinV3x64\801BFF8C
2 - Create a Py file
3- call Py file in batch file and test the bat.file to be sure if it works fine.
4- Create a POU file in codesys
Command : STRING(200):='C:\Users\tsw08\Desktop\Bat.bat';
IF fbTimer1.Q THEN
//Reset it and flash again
counter2 := counter2 +1;
fbTimer1(IN:= FALSE);
Test_2 := SysProcessExecuteCommand(pszComand:= Command , pResult:= ADR(dutResult));
END_IF
This is my bat.file
and this is my Python script :