The parameters described here are used implicitly by the FP-I4C function blocks.
This is for information only! All file operations and FTP or email transmissions are handled by the function blocks in the FP-I4C library.
File operations include reading and writing data in TXT and CSV files stored in the FP-I4C unit or in connected storage devices, and FTP or email transmission.
The file operation parameters are contained in a tag that is placed as a string in the PLC program. The tags contain file operation parameters and PLC addresses. The maximum number of characters for each tag is 128 (including the brackets).
Examples:
Attach a CSV file: {A_D_00200_00066_S04_filename.csv}
Attach a text file: {A_D_00200_00001_T01_filename.txt}
Find a string in a line and write the entire line into a target string (00200: start address of the string to find, 00300: start address of the target string): {A_D_00200_00300_r01_filename.txt}
Find the line of a specified string and replace it with another line (00200: start address of the string to find, 00300: start address of the replacement string): {A_D_00200_00300_m01_filename.txt}
Test if a file exists: {A_D_00200_00000_P01_filename.txt}
Character offset |
Parameter |
Values |
Example |
|
---|---|---|---|---|
CSV files |
TXT files |
|||
+0 |
Start code |
{A |
|
|
+3 |
PLC register type |
D: DT, F: FL, L: LD |
|
|
+5 |
Pointer to start of data 1 |
First PLC register address to read |
Start address of the Control FPWIN Pro7 string header |
|
+11 |
Number of registers or pointer to start of data 2 |
Number of PLC registers to read |
Start address of theControl FPWIN Pro7 target or replacement string header for the operations modes r and m; No data is written if the start address of the target string is 0000. |
CSV: TXT: |
+17 |
Operation mode |
K,k: Cell terminator ',' (comma) S,s: Cell terminator ';' (semicolon) P: Restore existing CSV file data from the data storage location back to the PLC. F: Send a file from the data storage location via FTP or email. D: Delete a file from the data storage location. Lowercase characters store the data without sending them via FTP or email. |
T,t: Write and forward a TXT file via FTP or email. a: Append a string to an existing TXT file. If the file does not exist, a new file is created. r: Search for a line that contains the text specified by Pointer to start of data 1. Each line must be terminated with LF (line feed control code). If the text of data 1 begins with * (asterisk), the search text can be at any position within the line. The read result or error information is stored in data 2. m*: Replace a line that contains the text specified by Pointer to start of data 1. Each line must be terminated with LF (line feed control code). If the text of data 1 begins with * (asterisk), the search text can be at any position within the line. The replaced data or error information is stored in data 2. If data 1 is empty, a new line with data 2 is inserted at the line specified by Number. Lowercase characters store the data without sending them via FTP or email. |
|
+18 |
Number |
Number of CSV columns |
For r and m: number of lines to search for, for all other functions |
|
+17 |
File name |
Name of the attached file plus } You can use file names with all characters that are typically allowed in file systems (including the blank). You may choose a different extension than TXT or CSV. The delete operation allows using wildcards (*, ? but not the combination *.*) to remove a set of files. |
|