22.11.7.7 Label Settings

Listed Files (CF_FILELIST_NUM/SD_FILELIST_NUM/USB_FILELIST_NUM)

Stores the number of listed files actually written to the internal device when the File List Output function "_CF_dir( )/_SD_dir( ) /_USB_dir( )" is executed.

Usage example

_CF_dir ("\DATA\*.*", [w:[#INTERNAL]LS0100], 10, 0)
[w:LS0200] = [s:CF_FILELIST_NUM]

When obtaining a file list of the 10 files and the specified folder contains only five files, "5" is stored in [s:CF_FILELIST_NUM].

Read Bytes (CF_READ_NUM/SD_READ_NUM/USB_READ_NUM)

Stores the number of bytes actually read when the File Read function "_CF_read( )/_SD_read( ) /_USB_read( )" is executed.

Usage example

_CF_read ("\DATA", "DATA0001.BIN", [w:[#INTERNAL]LS0100], 16, 16)
[w:[#INTERNAL]LS0200] = [s:CF_READ_NUM]

When an attempt is made to read 16 bytes but only 12 bytes are read successfully, "12" is stored in [s:CF_READ_NUM].

Error Status (CF_ERR_STAT/SD_ERR_STAT/USB_ERR_STAT)

Stores the status of errors that occur at the time of access to external storage or during file operation.

Bit Position

Error Name

Description

15

Reserved

Reserved

14

13

12

11

10

9

8

7

6

File rename error

  • External storage was removed during execution.

  • Specified file does not exist

  • SD card is write protected.

5

File delete error

  • External storage was removed during execution.

  • The specified file does not exist

  • An attempt was made to delete a read-only file.

  • SD card is write protected.

4

File write error

  • External storage was removed during execution.

  • There was insufficient space in external storage.

  • An attempt was made to write on a read-only file.

  • An attempt was made to "overwrite" a file that does not exist

  • SD card is write protected.

3

File read error

  • External storage was removed during execution.

  • Specified file does not exist

2

File list error

  • External storage was removed during execution.

  • Specified folder does not exist

1

External Storage Error

  • External storage is not correctly formatted or is invalid.

0

No external storage

  • No external storage is inserted

  • CF card cover is open

Usage example

_CF_dir ("\DATA\*.*", [w:[#INTERNAL]LS0100], 2, 1) // Output file list
if ([s:CF_ERR_STAT02] 0) // Check error status.
{
 set ([b:[#INTERNAL]LS005000]) // Set error display bit address.
}
endif

Error Detail Status Storage Area

Each Bit will be set when an error occurs. You can check what factors lead to the error by setting Detail Status. In each function, Detail Status is stored in the Extended System Area. This area is read-only.

CF/SD card: LS9132 to LS9137

USB storage: LS9138 to LS9143

Error list for each function

Editor Function Name

 

Error Status

Cause

_CF_dir ( )

_SD_dir ( )

LS9132

0010h

Invalid D-Script data (Error in retrieving folder name specified with fixed string)

0012h

File name (path name) error

0018h

LS Area writing range error

0020h

No CF/SD card

0021h

CF/SD card error

0100h

Directory open error

 

Editor Function Name

 

Error Status

Cause

_CF_read ( )

_SD_read ( )

LS9133

0010h

Invalid D-Script data (Error in retrieving folder name/file name specified with fixed string)

0011h

LS Area reading range error

0012h

File name (path name) error

0018h

LS Area writing range error

0020h

No CF/SD card

0021h

CF/SD card error

0101h

File seek error (Offset error)

0102h

Number of readout bytes error

0110h

File creation (open) error

 

Editor Function Name

 

Error Status

Cause

_CF_write ( )

_SD_write ( )

LS9134

0010h

Invalid D-Script data (Error in retrieving folder name/file name specified with fixed string)

0011h

LS Area reading range error

0012h

File name (path name) error

0020h

No CF/SD card

0021h

CF/SD card error

0101h

File seek error (Offset error)

0104h

Folder creation error

0108h

Write mode error

0110h

File creation (open) error

0111h

File write error (for example, insufficient space on the CF/SD card or the SD card is write protected)

 

Editor Function Name

 

Error Status

Cause

_CF_delete ( )

_SD_delete ( )

LS9135

0010h

Invalid D-Script data (Error in retrieving folder name/file name specified with fixed string)

0011h

LS Area reading range error

0012h

File name (path name) error

0020h

No CF/SD card

0021h

CF/SD card error

0112h

File delete error (for example, the file does not exist, the file is read-only, or the SD card is write protected)

 

Editor Function Name

 

Error Status

Cause

_CF_rename ( )

_SD_rename ( )

LS9136

0010h

Invalid D-Script data (Error in retrieving folder name/file name specified with fixed string)

0011h

LS Area reading range error

0012h

File name (path name) error

0020h

No CF/SD card

0021h

CF/SD card error

0114h

File rename error (for example, the file does not exist, the file name already exists or the SD card is write protected)

 

Editor Function Name

 

Error Status

Cause

_CF_read_csv ( )

_SD_read_csv ( )

LS9137

0001h

Parameter error

0002h

CF/SD card error (no CF/SD card, file open error, file read error)

0003h

Write Error

 

Editor Function Name

 

Error Status

Cause

_USB_dir ( )

LS9138

0010h

Invalid D-Script data (Error in retrieving folder name specified with fixed string)

0012h

File name (path name) error

0018h

LS Area writing range error

0020h

No USB storage

0021h

Invalid USB storage

0100h

Directory open error

 

Editor Function Name

 

Error Status

Cause

_USB_read ( )

LS9139

0010h

Invalid D-Script data (Error in retrieving folder name/file name specified with fixed string)

0011h

LS Area reading range error

0012h

File name (path name) error

0018h

LS Area writing range error

0020h

No USB storage

0021h

Invalid USB storage

0101h

File seek error (Offset error)

0102h

Number of readout bytes error

0110h

File creation (open) error

 

Editor Function Name

 

Error Status

Cause

_USB_write ( )

LS9140

0010h

Invalid D-Script data (Error in retrieving folder name/file name specified with fixed string)

0011h

LS Area reading range error

0012h

File name (path name) error

0020h

No USB storage

0021h

Invalid USB storage

0101h

File seek error (Offset error)

0104h

Folder creation error

0108h

Write mode error

0110h

File creation (open) error

0111h

File write error (For example, insufficient space on USB storage)

 

Editor Function Name

 

Error Status

Cause

_USB_delete ( )

LS9141

0010h

Invalid D-Script data (Error in retrieving folder name/file name specified with fixed string)

0011h

LS Area reading range error

0012h

File name (path name) error

0020h

No USB storage

0021h

Invalid USB storage

0112h

File delete error (For example, specified file does not exist or specified file is read-only)

 

Editor Function Name

 

Error Status

Cause

_USB_rename ( )

LS9142

0010h

Invalid D-Script data (Error in retrieving folder name/file name specified with fixed string)

0011h

LS Area reading range error

0012h

File name (path name) error

0020h

No USB storage

0021h

Invalid USB storage

0114h

File rename error (For example, specified file does not exist or file name already exists)

 

Editor Function Name

 

Error Status

Cause

_USB_read_csv ( )

LS9143

0001h

Parameter error

0002h

USB storage error (No USB storage, File open error, File read error)

0003h

Write Error