Access violation on RaspberryPi

sg
2019-05-07
2019-05-07
  • sg - 2019-05-07

    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

     
  • dFx

    dFx - 2019-05-07

    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).

     

Log in to post a comment.