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

Use SysFileGetSize

gatto
2019-10-22
2019-10-22
  • gatto

    gatto - 2019-10-22

    Hi, I'm not very good at programming codesys.
    I'm trying to use the SysFileGetSize function to test whether a file exists or not.
    Now I'm trying to simulate on my computer and i put in the folder: C:\ProgramData\CODESYS\Simulation\PlcLogic
    a file named myfile.txt.

    In simulation I see the correct size of the file.
    I don't know what to put in pResult.
    I'm looking for a way to read the error no object.
    My goal is have a message when the file does not exist.
    Currently when I delete the file I only get the size at zero.
    I'm looking for a way to read the error no object, thanks !

    IMG: file1.jpg

     
  • gatto

    gatto - 2019-10-22

    found the solution:
    adr(what) on pResult

     

Log in to post a comment.