According to the help file "If you declare a local variable in a function block as RETAIN, CODESYS stores the complete instance of this function block in the Retain range (all data of the function block); however, only the declared RETAIN variable is treated as such." (https://help.codesys.com/api-content/2/ ... ersistent/)
I created a function block with only the following variables:
I have a program that only implements one instance of this function block. Using SIZEOF at runtime shows a function block size of 312 bytes
Now, if I right click on the device, and go to "Device Memory Info", the size of my Retain Data is only 203 bytes.
If the complete instance of the function block is stored in the retain range, I would expect the retain data size to be the same as the function block size (312 bytes), but it isn't, it's only 203 bytes--the size of the retain data. Is the manual incorrect?
I am using Schneider M241 PLC with Machine Expert 1.1, which is using Codesys 3.5 SP12
thanks
Tim
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
According to the help file "If you declare a local variable in a function block as RETAIN, CODESYS stores the complete instance of this function block in the Retain range (all data of the function block); however, only the declared RETAIN variable is treated as such." (https://help.codesys.com/api-content/2/ ... ersistent/)
I created a function block with only the following variables:
I have a program that only implements one instance of this function block. Using SIZEOF at runtime shows a function block size of 312 bytes
Now, if I right click on the device, and go to "Device Memory Info", the size of my Retain Data is only 203 bytes.
If the complete instance of the function block is stored in the retain range, I would expect the retain data size to be the same as the function block size (312 bytes), but it isn't, it's only 203 bytes--the size of the retain data. Is the manual incorrect?
I am using Schneider M241 PLC with Machine Expert 1.1, which is using Codesys 3.5 SP12
thanks
Tim
That is the question I'm also looking answer for!
Anyone has more info?