Welcome to our new forum
All users of the legacy CODESYS Forums, please create a new account at account.codesys.com. But make sure to use the same E-Mail address as in the old Forum. Then your posts will be matched. Close

SysFileOpen does not work after update to V3.5 SP19 Patch 5

kleeswi
2024-02-19
2024-02-19
  • kleeswi - 2024-02-19

    I use the function SysFile.SysFileOpen(sFileNamePara, SysFile.ACCESS_MODE.AM_WRITE, pErrorFileOpen); to open and write a file.
    Since the update from Codesys V3.5 SP17 to V3.5 SP19 Patch 5 it does not work anymore. I first had SysFile.SysFileOpen(sFileNamePara, SysFile.ACCESS_MODE.AM_APPEND_PLUS, pErrorFileOpen); in both versions.
    hFile_Test is a pointer to byte. It gives an exceptional error when dereferencing the hFile_Test pointer.

    Edit: I use Codesys on a Raspberry pi

     

    Last edit: kleeswi 2024-02-19
  • Reinier Geers - 2024-02-19

    At 19.1 the hFile_test should be RTS_IEC_HANDLE and always open-write - close in one cycle

    udi_handle:             RTS_IEC_HANDLE;         //handle-number. Is created by SysFileOpen
    
    udi_handle:=SysFileOpen(sFileName,Sysfile.AM_WRITE_PLUS, ADR(udi_ErrorCode));       
    udi_RetValWrite:=SysFileWrite(udi_handle, pRemBuffer, szRemBufSize, ADR(udi_ErrorCode));    
    //closing file  
    IF udi_RetValWrite < szRemBufSize THEN  ui_Error:=cWriteError;  END_IF//error writing data
    udi_ErrorCode_Close:=SysFileClose(udi_handle);
    
     
  • kleeswi - 2024-02-19

    But thank you!

     

    Last edit: kleeswi 2024-02-19

Log in to post a comment.