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

Warm Reset

mkhogali
2021-04-19
2021-04-27
  • mkhogali

    mkhogali - 2021-04-19

    Hi there,
    I'm working in a project of wago controller which is programmed by codesys 3.5, and I'm looking for way to let the operator to reset the controller from the HMI, so if there any ready function that can make this directly from the software without physical touching the controller.

     
  • Ton

    Ton - 2021-04-19

    Hi,

    My solution:

    Create program:
    PROGRAM Ethercat_INode
    VAR
    pApp: POINTER TO CmpApp.APPLICATION;
    result: RTS_IEC_RESULT;
    xInit: BOOL:= TRUE;
    xRestartApp: BOOL; //Visu
    END_VAR
    VAR RETAIN
    xAutoRestart: BOOL;
    END_VAR
    IF xInit THEN
    pApp:= AppGetCurrent(pResult:= result);
    xInit:= FALSE;
    xAutoRestart:= FALSE;
    END_IF

    IF xRestartApp THEN
    xRestartApp:= FALSE;
    CmpApp.AppReset(pApp:= pApp, usResetOption:= CmpApp.RTS_RESET);
    xAutoRestart:= TRUE;
    END_IF

    Create function:
    FUNCTION SysEvent_StopDone : DWORD
    VAR_INPUT
    EventPrm: CmpApp.EVTPARAM_CmpAppStop;
    END_VAR
    IF Ethercat_INode.xAutoRestart THEN
    CmpApp.AppStartApplication(Ethercat_INode.pApp);
    END_IF

    In Task Configuration/System Events add event Handler StopDone and fuction call to SysEvent_StopDone.

    Hopefully this helps.

     
  • awal

    awal - 2021-04-27

    This works kind of...
    I'm using a PFC200 controller with the latest firmware. When the user resets or restarts the wago controller from his HMI the application restarts like it should but the run led on the controller turns red and stay red until the controller is power cycled. The controller is fully functional but the run led remains red. Could someone find a fix or a solution for this?

     

    Last edit: awal 2021-04-27
    • mkhogali

      mkhogali - 2021-04-27

      U mean the controller work OK the only issue is the red led??

       
  • awal

    awal - 2021-04-27

    Yes. The controller works ok after the user requests a reset but the run led is red. Not sure how reliable the controller would be when the run led isn't green. Ok for a hobby project maybe, or during development but not in production.

     

    Last edit: awal 2021-05-14

Log in to post a comment.