I’ve encountered some unexpected behavior while working with arrays in Automation Runtime.
When accessing an index outside of the declared array bounds, I don’t get any runtime error. Instead, the program reads the value from the next memory location. Moreover, it is also possible to write to that location.
From my understanding, I would expect either a bounds check or a runtime exception.
Is this the expected behavior in AR?Are there specific settings (e.g., compiler options, runtime checks) that control array bounds checking?
it is correct that the default Settings are not sending an Error when going out of Array bounds. It is mandatory that the Developer takes care of the Array Index to be inside of the bounds.
If you want to check your Applikation for Array Bound errors. You can use the IEC_CHECK - Library.