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

Retrigger Execution of Initialization Slots

rickj
2021-11-11
2021-11-13
  • rickj - 2021-11-11

    We've made effective use of the init slot mechanism in our projects. In our most recent project, the end user is able to configure a number of software objects at runtime, however, such configuration is dependent on sequential execution of methods assigned to initialization slots.

    I'm looking for a way to retrigger the initialization process from PLC code (visu button press probably), that execute the initialization process that occurs after a warm reset. There was mention of a PLC Control Library in an old forum thread but it seems to not exist.

    Is what I'm asking possible? If so, is there an example, documentation, a library, or any other advice which mat be helpful.

     
  • rickj - 2021-11-13

    The CmpApp library seems to support this functionality. The online help topic below explains what to do. Basically, the CmpApp.AppReset() function is called to perform a Warm/Cold reset, leaving the controller offline. A 'StopDone' event triggered task is defined that executes the CmpApp.AppStartApplication() function to bring the controller back online.

    https://faq.codesys.com/display/CDSFAQ/Automatic+Restart+of+the+Application+after+Resetting+from+IEC+Code

     
  • rickj - 2021-11-13

    This appears to work as advertised. However, a visualization screen active in the ide before the reset remains offline after the reset is complete and the PLC come back online. This behavior has been observed before but had occured only occasionally/randomly. However, this behavior reproducible every time using this method of reset and would appear to be a visualization bug.

    I wonder if it's necessary to do more to ensure that the previously active visu screen comes back online after these resets?

     

Log in to post a comment.