Welcome to our new forum
All users of the legacy CODESYS Forums, please create a new account at account.codesys.com. But make sure to use the same E-Mail address as in the old Forum. Then your posts will be matched. Close

launch external application from codesys

Anonymous
2009-08-25
2016-05-05
  • Anonymous - 2009-08-25

    Originally created by: Stefano.Casarini

    I need to launch and run after codesys bootproject a visual basic project.exe:

    Is possible to launch by codesys an external program for example ".exe" of visual basic??

    Regars

    Stefano

     
  • Andreas Kehrer - 2009-08-27

    Yes, it's possible. Please have a look to the SysProcess.library (V3) or the SysLibOs.lib (V2) library. You can start an application from your IEC code by calling the function SysProcessCreate2 (V3) or SysCreateProcess (V2).

     
  • Anonymous - 2009-08-28

    Originally created by: Stefano.Casarini

    Hi,

    my codesys runtime is for target winXP and in the folder of the available libraries (\Lib_NTRT) there isn't SysLibOs.lib.

    But SysLibOs.lib is in the folder \Lib_PLCWinNT so i add this library, use the function SysCreateprocess and build-all and it's ok but when i download the program to the target it shows the message "Unresolved external POU: SysCreateProcess _"

    Regards,

    Stefano

     
  • spfeif - 2009-09-17

    Check and make sure there is also a .hex file in the folder as well. It appears to be an external library instead of an internal library so it will need the compiled file.

     
  • Anonymous - 2009-09-18

    Originally created by: Stefano.Casarini

    I don't find any .hex file.. can you send me the .hex file that i have to compile?In which folder i'd to find the *.hex file?

    regards

    Stefano

     
  • spfeif - 2009-09-18

    I do not have the realtime system. Sorry.

     
  • aes - 2013-10-02

    You can call a external program via the macro function during prebuild and post build:

    Project -> Options -> Macro
    - Define marcos. I have to use absolute path:
    call $PROJECT_DRIVE$$PROJECT_PATH$\macro\PostBuild_exp_copy_wdatetime.mac

    You can run a macro before and after build:
    Project -> Options -> Build
    Macro before build: prebuild.mac
    Macro after Build: PostBuild_exp_copy_wdatetime.mac

    In the macro you can make system calls:
    in my PostBuild.mac:

    ;; this only copies the 2nd digit of the hour this will overwrite files -> %time:~1,1%
    system copy $PROJECT_DRIVE$$PROJECT_PATH$\$PROJECT_NAME$.exp $PROJECT_DRIVE$$PROJECT_PATH$\$PROJECT_NAME$%date:~-4,4%%date:~-10,2%%date:~-7,2%%time:~1,1%%time:~3,2%%time:~6,2%.exp

     
  • lkxcodesys - 2016-05-05

    Hi, aes,
    I tried with your macro code, but seems the path like what you wrote:

    Zitat:
    $PROJECT_DRIVE$$PROJECT_PATH$\$PROJECT_NAME$.exp

    It doesn't work.
    I have to use absolute path.
    Do you know how to fix it?

    On the other hand, do you have the macro command list of CoDeSys?
    Because there is quite few information about macro in the manual.
    For example, now I want to export just the Global Variables to EXP file.
    But with my macro, my CoDeSys project always export the EXP file of the whole project.
    Do you konw is there any way to get my need?

    Thanks!

     

Log in to post a comment.