Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • Create a new function named taskev_StopDone with the return type DWORD.



    Then adapt the function as follows:



    Section
    Column
    width7

    Declaration

    Column
    width93
    Code Block
    themeConfluence
    FUNCTION taskev_StopDone : DWORD
    VAR_INPUT
        EventPrm: CmpApp.EVTPARAM_CmpAppStop;
    END_VAR
    VAR
    END_VAR




    Section
    Column
    width7

    Implementation

    Column
    width93
    Code Block
    themeConfluence
    IF PersistentVars.xAutoRestart THEN
    	PersistentVars.udiCnt := PersistentVars.udiCnt + 1;
    	CmpApp.AppStartApplication(PLC_PRG.pApp);
    END_IF






  • Open the tab in the task configuration:

    Image Added

    Create a new event of type StopDone and assign the function taskev_StopDone to it.

    Image Added

    Image Added


  • Start the project and set the variable xReset to TRUE in order to index it.

    Image Added

    Note

    The variable PersistantVars.udiCnt is incremented from the application with each restart.