OpenDir always in error

2024-07-31
2024-08-01
  • jmfernandes - 2024-07-31

    Hello I'm trying to use DirOpen to access a directory where then I can read/list the files inside.
    But I can't list any files because DirOpen.xError is always true.
    In eError the message is this:
    " ERROR_UNKNOWN Local library error ID (0: no error; 5101: time out)**** "

    I have in the file explorer the path 'C:\CodesysTest\Aluminium' and to make sure I also created in the plc a folder to 'prj/Recipes/Aluminium'. I tried using the different paths, but in both it happens the same thing.Inside the folder Aluminium there is two csv files, that I want to list.

    I added in the library manager CAA Files and CAA Types.
    I am using the example of https://content.helpme-codesys.com/en/libs/CAA%20File/Current/Examples.html#directory

    but not matter what I do, I can't get the list the names of the files.

    What am I missing?

     
  • jmfernandes - 2024-07-31

    Hello just to give more feedback the error I get is
    "ERROR_UNKNOWN :represents raw value of 5110" in File.DirOpen. The xDone never gets true, and I never get the listing of files (csv files in this case).
    In the hDir i get the value of 0 for a DWord!?

     
  • jmfernandes - 2024-08-01

    Thanks for the answer Tim.
    I am using the codesys version 3.5 SP16, is this also affected or only after version 19?
    But now at leastI know that is an acess problem to the file and not something else.
    Unfortunately the link you posted on 2023 are now dead, but I will investigate!

     
  • jmfernandes - 2024-08-01

    Well I created a user as Admin, gave access rigths to the file but still can't read the files in the plc it gives the same error. I guess is something to do with plc itself.

     

Log in to post a comment.