
The Inline controller under PC Worx
6959_en_07
PHOENIX CONTACT
49
3.5.3
FILE_READ
The FILE_READ block is used to read data from a file that was opened previously.
Figure 3-4
FILE_READ block
•
Assign the valid handle for the file from which data is to be read to the “Handle” input.
•
Create a data buffer of sufficient size for the “Buffer” output.
The data buffer for the data to be read can be declared in a number of ways. The type of
data buffer can be defined by the user, e.g., a byte array. Strings cannot be used directly as
data buffers. If the data read is to be processed further as a string, it must first be saved in
an array and then converted into a string using the BUF_TO_STRING function block.
•
Enter the number of bytes to be read at the “MaxLength” input.
•
Activate the block on a rising edge at the “Execute” input.
The execution of the function block is complete when the “Done” output is set to 1.
If an error occurred during execution, the value at the “Error” output = 1.
“ErrorID” indicates the number of the cause of the error.
Following successful execution, the data is copied to the buffer and the number of
characters read is entered at the “LengthRead” output. The number of characters read may
be less than “MaxLength” if the end of the file was reached before the number of characters
entered was processed.
7018B028
FILE_READ
Execute
Handle
MaxLength
LengthRead
Buffer
Done
Buffer
Error
ErrorID
Summary of Contents for ILC 330 Series
Page 1: ...User manual Installing and operating the ILC 330 and ILC 350 Inline controllers...
Page 8: ...ILC 330 350 8 PHOENIX CONTACT 6959_en_07...
Page 10: ...ILC 330 350 10 PHOENIX CONTACT 6959_en_07...
Page 42: ...ILC 330 350 42 PHOENIX CONTACT 6959_en_07...
Page 68: ...ILC 330 350 68 PHOENIX CONTACT 6959_en_07...