Hello,
I have a question about how CodeSys deals with out of bound accesses.
For example if I define an array like so :
test_array:ARRAY[0..9]OFBYTE;
And in my code if I do :
i:=10;test_array[i]:=12;
Surprisingly, no exception is raised and the value is written in the memory at the corresponding address. I can even modifiy the values of other variables in the programm by doing that.
So my question is : is there a way to detect an out of bound exception ?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello,
I have a question about how CodeSys deals with out of bound accesses.
For example if I define an array like so :
And in my code if I do :
Surprisingly, no exception is raised and the value is written in the memory at the corresponding address. I can even modifiy the values of other variables in the programm by doing that.
So my question is : is there a way to detect an out of bound exception ?
Look here, checkbounds...
https://faq.codesys.com/plugins/servlet/mobile?contentId=3538982#content/view/3538982
It looks really useful, thank you !
If I understand correctly, this block monitors every array of my program simultaneously ?
yes, thats right!