21.11.5.1 Label Settings

The following are possible status values for CF Card/USB Storage Status.

Listed Files

When the File List Output function "_CF_dir ( )" or "_USB_dir ( )" is executed, the number of file lists that are actually written in the LS Area is stored in "Listed Files [s:CF_FILELIST_NUM]/[s:USB_FILELIST_NUM]".

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

Number of Read Bytes

When the File Read function "_CF_read ( )" or "_USB_read ( )" is executed, the number of bytes actually read out is stored in "Readout Bytes [s:CF_READ_NUM] / [s:USB_READ_NUM].

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

CF Card/USB Storage Error Status

Stores the error status generated when the CF Card or USB Storage is accessed.

Bit Position

Error Name

Description

15

Reserved

Reserved

14

13

12

11

10

9

8

7

6

File rename error

  • CF Card/USB Storage is removed during execution

  • Specified file does not exist

5

File delete error

  • CF Card/USB Storage is removed during execution

  • Specified file does not exist

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

4

File write error

  • CF Card/USB Storage is removed during execution

  • Exceeded available space on CF Card/USB Storage

  • An attempt was made to write data to a file with a read-only attribute

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

3

File read error

  • CF Card/USB Storage is removed during execution

  • Specified file does not exist

2

File list error

  • CF Card/USB Storage is removed during execution

  • Specified folder does not exist

1

CF Card/USB storage error

  • CF Card/USB Storage is invalid

  • The media inserted is not a CF Card

0

No CF Card/USB Storage

  • CF Card/USB storage is not inserted

  • Cover is open

CF Card/USB storage 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 LS9132 to LS9137 for Extend System Area (LS9138 to LS9143 for USB storage). These areas are read-only.

Error list for each function

Editor Function Name

 

Error Status

Cause

_CF_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 Card

0021h

Invalid CF Card

0100h

Directory open error

 

Editor Function Name

 

Error Status

Cause

_CF_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 Card

0021h

Invalid CF Card

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 ( )

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 Card

0021h

Invalid CF Card

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 CF Card)

 

Editor Function Name

 

Error Status

Cause

_CF_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 Card

0021h

Invalid CF Card

0112h

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

 

Editor Function Name

 

Error Status

Cause

_CF_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 Card

0021h

Invalid CF Card

0114h

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

 

Editor Function Name

 

Error Status

Cause

_CF_read_csv ( )

LS9137

0001h

Parameter error

0002h

CF Card error (No CF Card, Open file 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. 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. 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

Data Storage Mode

When data is read/written from/to device addresses at the execution of the File Read/File Write function, the storage order of the written (readout) data can be specified.

Setting the data storage mode in LS9130 can change the storage order. The mode can be selected from four options: 0, 1, 2 or 3.

For example, when the File Read function is used to write a string "ABCDEFG" in a device address

[w:[#INTERNAL]LS9130] = 0
_CF_read ("\DATA", "DATA0001.BIN", [w:[#INTERNAL]LS0100], 0, 7)

For example, when the File Read function is used to write a string "ABCDEFG" in a device address

[w:[#INTERNAL]LS9130] = 1
_CF_read ("\DATA", "DATA0001.BIN", [w:[#INTERNAL]LS0100], 0, 7)

For example, when the File Read function is used to write a string "ABCDEFG" in a device address

[w:[#INTERNAL]LS9130] = 2
_CF_read ("\DATA", "DATA0001.BIN", [w:[#INTERNAL]LS0100], 0, 7)

For example, when the File Read function is used to write a string "ABCDEFG" in a device address

[w:[#INTERNAL]LS9130] = 3
_CF_read ("\DATA", "DATA0001.BIN", [w:[#INTERNAL]LS0100], 0, 7)