I am struggling to understand the CheckPointer function in CoDeSys. The help file says that if I include a function that is exactly named "CheckPointer", the function shall "be called automatically before each access on the address of a pointer." This statement suggests that I do not have to make an explicit call to the function, but if I don't call the function, I do not understand how to obtain the result of the implicit function call. So I start with two questions:
1) How do I obtain the DWORD result of the CheckPointer function call?
2) What is the result indication for a valid memory versus an invalid memory location?
The function declaration looks like this:
FUNCTIONCheckPointer:DWORDVAR_INPUT  dwAddress  :  DWORD;  iSize    :  DINT;  bWrite    :  BOOL;END_VAR
I am using a 32-bit system.
This brings me to my third question. The help file does not indicate any code for the CheckPointer function, just its interface declaration.
3) Do I need to add any code into the actual CheckPointer function?
If the answer to question #3 is that no code needs to be added, then how is the CheckPointer function actually testing anything?
Finally, is there any example code that illustrates the proper use of this CheckPointer function? The help file does not seem to go any further than describing the input interface, but this is no illustration of how to use it.
Thank you for whatever explanations you can provide.
Kind regards,
The Captive Engineer
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Even i am stuck at same problem.
Request codesys to provide a good explaination of "checkpointer" function, similar to one shown for "CheckBounds" function.
Early help shall be appreciated.
Regards,
Winy Kakani
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The reason behind a stub implemented for CheckPointer is that depends on what exactly the function should check for you. Since this can widely differ a single implementation cannot be given. In other words because there are so much possibilities for usage, a single implementation is not possible.
The programmer should think about what the checkpointer functionality should check/do and provide an implementation accordingly.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Originally created by: Captive Engineer
Hello.
I am struggling to understand the CheckPointer function in CoDeSys. The help file says that if I include a function that is exactly named "CheckPointer", the function shall "be called automatically before each access on the address of a pointer." This statement suggests that I do not have to make an explicit call to the function, but if I don't call the function, I do not understand how to obtain the result of the implicit function call. So I start with two questions:
1) How do I obtain the DWORD result of the CheckPointer function call?
2) What is the result indication for a valid memory versus an invalid memory location?
The function declaration looks like this:
I am using a 32-bit system.
This brings me to my third question. The help file does not indicate any code for the CheckPointer function, just its interface declaration.
3) Do I need to add any code into the actual CheckPointer function?
If the answer to question #3 is that no code needs to be added, then how is the CheckPointer function actually testing anything?
Finally, is there any example code that illustrates the proper use of this CheckPointer function? The help file does not seem to go any further than describing the input interface, but this is no illustration of how to use it.
Thank you for whatever explanations you can provide.
Kind regards,
The Captive Engineer
Hi,
Even i am stuck at same problem.
Request codesys to provide a good explaination of "checkpointer" function, similar to one shown for "CheckBounds" function.
Early help shall be appreciated.
Regards,
Winy Kakani
The reason behind a stub implemented for CheckPointer is that depends on what exactly the function should check for you. Since this can widely differ a single implementation cannot be given. In other words because there are so much possibilities for usage, a single implementation is not possible.
The programmer should think about what the checkpointer functionality should check/do and provide an implementation accordingly.