File_Write - Phoenix Contact ILC 330 User Manual

Inline controllers
Table of Contents

Advertisement

The Inline Controller Under PC WorX
3.5.4

FILE_WRITE

The FILE_WRITE block is used to write data to a file that was opened previously.
Figure 3-5
FILE_WRITE block
Assign the valid handle for the file to which data is to be written to the "Handle" input.
Create a data buffer of sufficient size, which contains the data to be written, for the "Buffer"
input. The data buffer for the data 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 a string is to be saved in a file, the string must first be saved in an array using
the STRING_TO_BUF function block.
Assign the number of bytes to be written to the "Length" input.
Activate the block on a rising edge at the "Execute" input.
Execution of the function block is complete when the "Done" output is set to 1.
If the function could not be executed successfully, the number of bytes written will be
indicated at the "LengthWritten" output. It is the same as the number of characters to be
written.
If an error occurred during execution, the value at the "Error" output = 1.
"ErrorID" indicates the number of the cause of the error.
The status of the "Done", "LengthWritten", "Error", and "ErrorID" outputs is maintained until
a falling edge is detected at the "Execute" input.
3-9
6959_en_05
PHOENIX CONTACT

Advertisement

Table of Contents
loading

Table of Contents