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

How to read a csv file from local directory of plc

mkzini
2018-01-23
2018-01-31
  • mkzini - 2018-01-23

    Hy everybody,
    i have a big question. So I create a file .csv where i can print the state of some tags.
    These tags are the my machine settings and i can easily import in a excel file.
    Now i try to read back the parameter changed in the .csv file to initialize the machine in according with the changes of the parameters in the excel file.
    I have replaced the .csv file written before with the new file with the modification.
    now my problem is the multiple lines of the file and its dimension (more and less 35Kb)
    Thank You in advanced for any suggestion

     
  • Anonymous - 2018-01-31

    Originally created by: KevinR

    Hello mkzini,

    you have multiple options:

    • You can use the CAA File library from the CAA Technical Workgroup. There is a good documentation available, which also includes some examples to open/close/read/write/append etc.

    • Another option would be to use the CSV Utility library from the CODESYS Store (requires a Workstation license) -
      https://store.codesys.com/csv-utility.html

    • As I understood your application case, you want to save variable persistent based on a file storage and not with an retain memory. So in this case you can use the Persistence Manager.
      --> You can find the AC_Persistence module under the Module section.

    Best Regards,
    KevinR

    IMG: ACPersist.PNG

    IMG: Caa File.PNG

     

Log in to post a comment.