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.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thanks for the feedback. However, I don't have a solution for you at this time. Maybe someone else has a better solution for this? Then I am all ears for too.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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.
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
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.
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.
Thanks for the feedback. However, I don't have a solution for you at this time. Maybe someone else has a better solution for this? Then I am all ears for too.
Maybe you can use System Events.
https://help.codesys.com/webapp/_cds_obj_task_config_sys_event;product=codesys;version=3.5.15.0