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

“reset warm” and “start program” on softPLC CoDeSysV3.4 demo

and3
2011-08-17
2021-04-23
  • and3 - 2011-08-17

    Good morning everyone,

    I’m trying to find a way to perform a “reset warm” and “start program” on a softPLC CoDeSysV3.4 without using the User Interface (neither Online Menu nor PLC Shell).

    After some research, I know that for Codesys 2.3 it exist a library called SysLibPlcCtrl.lib which offers the functions that I need. More than that it exist a CoDeSys Control Service Tool CTS that permits two perform the same operations using Windows command line.

    I use the demo version of CoDeSys V3.4 SP3 Hotfix1 that doesn’t include the Control Service Tool.
    More than that, I’m not able to find the SysLibPlcCtrl.lib library or an equivalent on the V3.4 demo version. It exist such a library for Codesys V3.4? Is it included in the demo version?
    Is there another way to call a “warm reset” and “start program” in CoDeSys? I’d like to trigger a variable using an OPC client for performing a warm reset and start again the execution of the program.

    Is there a way to perform a warm restart using the Windows command line?

    Thank you very much,
    Andrei

     
  • TimvH

    TimvH - 2011-08-17
    • The CoDeSys Service Tool for V3.4 is available, but not free of charge. I don't know whether this has a command line interface.
    • You could create a Python script (>3.4 SP3) to execute these commands without opening the GUI.
    • In the SysLibs tree is a library "Component Manager" which could help you.
     
  • and3 - 2011-08-19

    Thank you for the reply,

    I’ve found an incomplete version of the CmpApp library inside the SysInfo project witch I’ve downloaded from the examples FTP folder: ftp://ftp2.3s-software.com/pub/Examples ... ogramming/
    I am now able to reset warm my project using the AppReset function. I don’t have the AppResetAllApplications function so in order to reset my application I have to specify it using the function AppGetFirstApp.
    The problem is that after the reset, the application doesn’t restart by simply using the AppStartApplication function. I have to click on the Start button and I don’t want this….

    Any ideas?

     
  • TimvH

    TimvH - 2011-08-20

    If you reset warm your application, the code is not executed anymore and you have to start the application again. In this case your code to start it, is not executed. This means your application can never be started this way.

    An option would be to have a main "Father" application which contains this code. Add to this application a new "child" application (right click on application and choose add object, now select again an application) which is actually the application you want to reset warm and start again.
    You download the father application and start it. Then you download the child application and also start it.

    From the father application you should be able to reset warm the child application (I never tested this).
    This father application should then also be able to start the child, because the father is still running.

    PS, you must have a device which supports running more than one application (not all are capable to do this).

    If you have succeeded in doing this, it would be great if you can upload you sample code (as .projectarchive).

     
  • eschwellinger

    eschwellinger - 2016-02-05

    Hi,
    a solution (not with two applications) but maybe this is more easier and straight forward.

    It would be possible by doing the following:
    by the ResetDone Event which calls the restart - see attached application

    pApp := AppGetFirstApp(ADR(Result));
    WHILE pApp <> 0 AND Result = Errors.ERR_OK DO
       AppStartApplication(pApp);
       pApp := AppGetNextApp(pApp,(ADR(Result)));
    END_WHILE
    

    BR
    Edwin

    ResetFromIEC.project [54.89 KiB]

     
    • awal - 2021-04-23

      I have this ResetFromIEC function working on my PFC200. After the restart the plc is running and functioning like it should but the run led is red instead of green. Is that normal?

       

      Last edit: awal 2021-04-23

Log in to post a comment.