Summary
The list of files that exist in the specified folder is written in the Internal Device. Parameter 1 indicates the CF Card data folder. Parameter 4 indicates the offset used to select a file/files within that folder. Parameter 3 indicates the number of files selected within that folder. Parameter 2 specifies the LS Area into which the files will be written. When the offset is specified as "0", the list starts from the first file.
Format
_CF_dir/_SD_dir/_USB_dir (folder name, save in addresses,
number of files, offset)
Parameter 1
Folder name: Fixed string (Maximum length is 32 single-byte characters)
Parameter 2
Write-To Address: Internal Device, Internal Device designated with
offset
Parameter 3
Number of file names: Numeric value, device address, temporary address
(maximum 32)
Parameter 4
Offset: Numeric Value, Device address, Temporary address
Example expression:
To output a file list containing two files when the offset is 1 (second file):
_CF_dir ("\DATA\*.*", [w:[#INTERNAL]LS0100], 2, 1)
When the statement above is executed while the following files exist in the DATA folder, file names "DATA0001.BIN" and "DATA02.BIN" are written to LS0100 and later areas.
For example, when Text Data Mode = 1
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
When the offset is specified as "0", the list starts from the first file.
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.
If the specified folder does not have enough files as specified, the remaining LS Area is filled with NULL characters ('\0').
If a file name has fewer than 12 characters, the empty positions are filled with NULL characters ('\0').
When defining a folder name, make sure you use "*.*", such as "\DATA\*.*". The asterisks *.* mean to display all files.
The number of
files actually listed is written in Listed Files [s:CF_FILELIST_NUM]/[s:SD_FILESET_NUM]/[s:USB_FILELIST_NUM].
For details, see 22.11.7.7 Label Settings.
Write-To LS Addresses are not counted as D-Script Addresses.
The file names are not sorted when they are written into the LS Area. They are written in order of creation (the order of FAT entry).
You can create the list by specifying a file extension. To list files that match the file extension: "DATA\*.BIN". However, you cannot use "*" within a file name.
The file name
storage order is defined by the Text Data Mode.
7.9.1 System
Settings [Device/PLC] Settings Guide