Hi, I tested out the sample (from Codesys HP "FileUtilitiesPI.project") to read / write Data from a file, it works fine, but how can I read Line by line (till $r/$n) or how can I handle the data bigger than 255 char? (e.g. store in a string Array?)
My Problem is that I get all data from the file with the funkction "Caa File.Read". with the size of the destination string (max. 255)
So please, is there sombody who can give a small sample, or description to me?
THX for your help
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2015-07-15
Originally created by: scott_cunningham
You can define a variable with a different string length such as s := STRING(5000). Additionally there is a read function where you can define the number of chars to read and create a Plc loop (read 200 chars, do something, every Plc scan). Note: longer string lengths take more processing power/time.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi, I tested out the sample (from Codesys HP "FileUtilitiesPI.project") to read / write Data from a file, it works fine, but how can I read Line by line (till $r/$n) or how can I handle the data bigger than 255 char? (e.g. store in a string Array?)
My Problem is that I get all data from the file with the funkction "Caa File.Read". with the size of the destination string (max. 255)
So please, is there sombody who can give a small sample, or description to me?
THX for your help
Originally created by: scott_cunningham
You can define a variable with a different string length such as s := STRING(5000). Additionally there is a read function where you can define the number of chars to read and create a Plc loop (read 200 chars, do something, every Plc scan). Note: longer string lengths take more processing power/time.