4/18/2023 5:34 AM | |
Joined: 1/21/2013 Last visit: 7/15/2024 Posts: 2987 Rating:
|
Hi gerami.ma35, To be honest, I have never seen such a - in my opinion - terrible way of programming. FC50 transfers the first 40 bytes of the local data stack, address register 1 and address register 2 to DB50. And FC51 writes this data back. (In FC51, double word 16 is not transferred back from DB50, it's transferred to DB50. This may be a bug in the program). This could be useful for saving and restoring data that may have been unintentionally changed between calls to these two functions. However, it's dangerous to read the local data before writing it because it will be uninitialized, so you shouldn't do it. Your screenshot does not show how the OB32 continues. If the OB32 ends after network 3, these two functions are useless. This is because the OB32 uses priority class 9 by default and therefore the local data stack for this priority class. If no other OB uses this priority class, there is no need to save the local data, if there is any reason at all. It would be interesting to see how the DB50 is used in the rest of the program. Maybe the stored data is used somewhere. Kind regards |
This contribution was helpful to
1 thankful Users |
4/18/2023 6:40 AM | |
Joined: 4/11/2023 Last visit: 7/24/2023 Posts: 4 Rating:
|
Dear Stefan Arcularius, Thanks for your help.
|
Follow us on