Codesys :How do i read all lines of text from a text file?

EnterDownload

Member
Join Date
May 2015
Location
NY
Posts
12
Hello
I am using codesys v3.5.
I am using the CAA File library to read/write lines of text from a file stored on my Festo PLC.
I have found out how to read 1 line of text from my text file.
But how do I read the next set of lines within the text file separately until the end of file is reached?

Example:

Read line 1
Read line 2
Read line 3
Read line 4
End of File

I know I would normally put the code in a "Repeat" loop until end of file ...but what should the code look like to read all lines until all lines have been read or End of File?

thanks

Jay
 
Maybe I need more explanation?

Im trying to read all lines from a text file stored on my PLC, 1 by 1

Something like the code below. The problem is this code below always reads the same 1st line...how do I change to the code to read the next lines in my file?..e.g. line 2, line 3, ect

Repeat

FileRead(xExecute:= TRUE, hFile:= hfile, pBuffer:= ADR(sReadLine), szBuffer:= SIZEOF(sReadLine));

Until xEOF

End_Repeat
 

Similar Topics

Hello, I´m using Codesys 2.3 and trying to access Wago I/O modules 750-430 and 750-530 by WORD variable (or maybe an array), unsure if it´s...
Replies
6
Views
1,811
Read Tag from Rockwell PLC from Codesys 3.5? Rockwell PLCs would be 5370s, 5380s, 5570s, and 5580s etc. It seems everyone's EtherNet/IP...
Replies
73
Views
21,027
Hello, I am using a Hitachi Micro EHV+ for a small project, and I wanted to have a Web visu, done with Codesys V3.5 SP13 Patch 2. I test the...
Replies
6
Views
267
Hello, I have a requirement to manage the text alignment dynamically. So, for example: 1. English Texts should be displayed from Left in...
Replies
0
Views
86
Hello, I am new to Codesys, and am trying to learn about it for a project we're developing. I've got a couple questions, but first a little...
Replies
1
Views
133
Back
Top Bottom