Summary
Modifies the file name. Parameter 1 designates the CF Card data folder. Parameter 2 designates the original file name. Parameter 3 designates the new name.
Format
_CF_rename/_SD_rename / _USB_rename (Folder name,
File name, New file name)
The file name can also be specified indirectly using internal addresses.
Parameter 1
Folder name: Fixed string (maximum 32 single-byte characters)
Parameter 2
File name: Fixed string (maximum 32 single-byte characters), Internal
Device (maximum 14 single-byte characters), Device with Offset Specification
(Internal Device) (Internal Device + Temporary address, maximum 14
single-byte characters)
Parameter 3
File name: Fixed string (maximum 12 single-byte characters), Internal
Device (maximum 12 single-byte characters), Device with Offset Specification
(Internal Device) (Internal Device + Temporary address, maximum 12
single-byte characters)
Example expression:
Defining the file name with a text string
_CF_rename ("\DATA","DATA0001.BIN","DATA1234.BIN")
In the above example, "\DATA\DATA0001.BIN" file is renamed "\DATA\DATA1234.BIN".
Defining the file name with an internal device
_CF_rename ("\DATA", [w:[#INTERNAL]LS0100], [w:[#INTERNAL]LS0200])
By storing the file name in LS0100 and LS0200, you can indirectly specify
file names.
Store the file name in LS0100 through LS0106 as follows.
For example, when Text Data Mode = 1
The above expression renames the file from "\DATA\DATA0001.BIN"
to "\DATA\DATA1234.BIN".
The error status
is stored for any error that occurs at the time of access to external
storage or during file operation. Even when errors occur, the
process continues. Therefore, when using the file operation function,
always write a script that checks for errors.
22.11.7.7 Label Settings
Only the 8.3 format (a maximum of 12 characters, with 8 characters for the file name, the period, and 3 characters for the extension) can be used for the file name. You cannot use file names longer than 12 characters.
To set the root folder, specify "" (empty string) as the folder name.
A folder name (directory name) cannot be changed.
Maximum length of parameter 1 folder name is 32 single-byte characters.
The folder name
can be appended to the parameter 2 file name. Maximum length of
parameter 2 folder name + file name is 32 single-byte characters.
For example, \DATA\01\DATA.bin
An Internal Device can be specified for the second and third parameters (File names). Specifying Internal Device allows indirect addressing of a file name. Also, when specifying parameter 2 internal devices, the maximum folder name + file name length is 14 single-byte characters.
When you specify
an internal device as the file name, the file name storage order
is defined in the Text Data Mode.
7.9.1 System
Settings [Device/PLC] Settings Guide
You cannot append a folder name to the third parameter's file name. If a folder name is appended, it will be ignored.
When an internal device is specified for the File name, it is not counted as a D-Script Address.
To specify a full path for a file name, specify "*" (asterisk) as the folder name.