How to define a startup task?

con2827
2016-04-07
2019-07-03
  • con2827 - 2016-04-07

    Is this possible w/ the r-Pi?

    On another plc in CodeSys v3.1, I could configure task type = External, event = on_Start. But I don't have these options for the r-pi, v3.5.

    Any way to do this? Is this a difference specific to ver 3.5 of CodeSys, or the r-Pi, or both?

     
  • Kalyani-K - 2019-07-02

    Hello and sorry for gravedigging,

    but I was just wondering the same(ish) thing:
    Is there a way in Codesys 3.5 with the 3.5.14.20 Pi Runtime to create tasks
    that will only be called once during startup/shutdown of the PLC?

    In my program I am opening a file in the local filesystem and
    if I stop or logout the program with a file handle opened
    it will raise an exception and I will have a bad time.

    Therefore I was thinking that I could write a task which would
    close any opened filehandles in order to shutdown gracefully.

    Thanks in advance!

     
  • e.kislov - 2019-07-03

    Hey,

    Task Configuration - System Events - Add Event Handler - Select event (PrepareStart, PrepareShutdown, etc.) - enter name for new (not existing!) function - add implementation.

    IMG: 03

     

Log in to post a comment.