I have a unique problem where the code runs fine on a windows soft plc, but gives an access violation on a raspberry pi
There is a large array initialized in a program/function block "bTempMem : ARRAY[0..1000000-1] OF BYTE;"
This is used initialize certain arrays by a function block using pointer access to it. It throws an access violation when trying to write to it.
Strangely, if I declare this as a global variable, then i dont get any access violation
Any help is appreciated
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I have a unique problem where the code runs fine on a windows soft plc, but gives an access violation on a raspberry pi
There is a large array initialized in a program/function block "bTempMem : ARRAY[0..1000000-1] OF BYTE;"
This is used initialize certain arrays by a function block using pointer access to it. It throws an access violation when trying to write to it.
Strangely, if I declare this as a global variable, then i dont get any access violation
Any help is appreciated
Make sure you get the pointer value correctly ex: ```
pPointer := REF(bTempMem);
or
pPointer := REF(bTempMem[0]);
```
Idealy put it in a cycling task (online edits may affects memory locations).