Hi,
I know that is possible launch a *.exe file from a button propriety in the codesys HMI, using the propiety "execute command". Is it possible do it also directly from ST code?
Thank you
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
VAR   sEditor     :STRING:='D:\Software\Notepad++\notepad++.exe';     pResult    :DWORD;   udiResult   :UDINT;END_VARudiResult:=SysProcessCreate2(sEditor,i_sFilePath,SYSPROCESS_CREATEFLAG_INTERACTIVE,pResult);
You shoud add the SysProcess library.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi, loraul, I have tried your code and add the SysProcess library.
PROGRAMPLC_PRGVAR  sEditor     :STRING:='C:\Program Files\XnView\xnview.exe';    pResult    :DWORD;  udiResult   :UDINT;  pszCommand    :STRING:='C:\Program Files\XnView\xnview.exe';  i_sFilePath:STRING;END_VARudiResult:=SysProcessCreate2(sEditor,i_sFilePath,SYSPROCESS_CREATEFLAG_INTERACTIVE,pResult);
but the execution "XnView" doesn´t response
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
I know that is possible launch a *.exe file from a button propriety in the codesys HMI, using the propiety "execute command". Is it possible do it also directly from ST code?
Thank you
Hi,
You could try ```
Sys ExecuteCommand( 'yourExe.exe' )
```
(without the blank after Sys, somehow, the forum does not allow to write it without blank, otherwise it creates just a: _)
from the SysOS23 library if your PLC supports this.
Best Regards
Hi,
yes but is depends on which Version you are using and additional which OS
your plc is running on.
BR
Edwin
Hi,
I include library SysOS23 in my project and I try to do it:
_('C:\Programmi\Notepad++\notepad++.exe');
but the notepad++.exe do not start.
In attachment my versions.
VersionInfo.txt [18.37 KiB]
Hi,
try this:
You shoud add the SysProcess library.
Hi, loraul, I have tried your code and add the SysProcess library.
but the execution "XnView" doesn´t response
Have you solved this ?
https://faq.codesys.com/plugins/servlet/mobile?contentId=106889218#content/view/106889218
https://faq.codesys.com/plugins/servlet/mobile?contentId=106889218#content/view/106889218