22.11.7.3 Read File

Reads the specified number of bytes of data in the file after the specified offset and writes it in the destination address.

_CF_read/_SD_read/_USB_read (folder name, file name, save in address, offset, number of bytes)

Example expression:

Defining text for the file name, and reading 16 bytes from offset 16

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

In the example above, 16 bytes of data starting from the 17th byte in the "\DATA\DATA0001.BIN" file are written to the area starting from LS0100.

Defining an internal device for the file name, and reading 10 bytes from offset 0

_CF_read ("\DATA", [w:[#INTERNAL]LS0100], [w:[#INTERNAL]LS0200], 0, 10)

By storing the file name in LS0100, you can indirectly specify the file name. In this example, a file name is stored in LS0100 through LS0106 as follows.

For example, when Text Data Mode = 1


In the example above, 10 bytes of data at the beginning of the "\DATA\DATA0001.BIN" file are read and written to the area starting from LS0200.