Command syntax for PLC file operations

The parameters described here are used implicitly by the FP-I4C function blocks.

NOTE

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.

Tags

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:

Parameters

Character offset

Parameter

Values

Example

CSV files

TXT files

 

+0

Start code

{A

{A_

+3

PLC register type

D: DT, F: FL, L: LD

D_

+5

Pointer to start of data 1

First PLC register address to read

Start address of the Control FPWIN Pro7 string header

00200_

+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; 00001_ to transmit data or 00000_ for a test command with P

No data is written if the start address of the target string is 0000.

CSV: 00066_

TXT: 00001_

+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.

S

+18

Number

Number of CSV columns

For r and m: number of lines to search for, for all other functions 01_

04_

+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.

filename.csv

Modified on: 2024-10-02Feedback on this pagePanasonic hotline