Detect Online change / Download

2020-06-02
2020-06-03
  • hence.persson - 2020-06-02

    I would like my code to set a bit before an eventual download (Both online change and download).
    Then I would like enough time to send this bit out via RS485 before eventual download/online change..
    I have the RS485 communication going in a task sending reciving much data.The only thing I want is to set a bit and send this out BEFORE the online change / download.

    Is this possible? I see there are suitable event handlers in the task management (Prepare online change, Prepare Download) but when I register these events will the normal program run? And if so for how long? (I would not like putting any RS485 code in the called event just set a bit in the called event. The RS485 code is in another part of the program building complete telegrams and sending them.

     
  • aliazzz

    aliazzz - 2020-06-02

    If possible, you could consider usage of FB_Init etc.
    See CODESYS help for more information on this initialisation mechanism

     

    Last edit: aliazzz 2020-06-02
    • hence.persson - 2020-06-02

      But I want the bit to be set and sent over to another system BEFORE download/online change not after as would be the case with FB_Init?

      But you may have pointed me in a good direction.. What about FB_Exit.. As I understand it this will be called before downloading/online change.

       
      • hence.persson - 2020-06-02

        Tested not what I want.. I want something regardless where the program has changed the method FB_Exit seems to work as intended but only if I have changed in that particular FB.

         

Log in to post a comment.