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.
Use the following to reference LS9130.
_CF_write() CF file operation: Write to file
_CF_read() CF file operation: Read file
_CF_read_csv() CF file operation: Read CSV file
_SD_write() SD file operation: Write to file
_SD_read() SD file operation: Read file
_SD_read_csv() SD file operation: Read CSV file
_USB_write() USB file operation: Write to file
_USB_read() USB file operation: Read file
_USB_read_csv() USB file operation: Read CSV file
IO_WRITE([p:PRN],...) Print operation: Send
When writing or reading to device addresses, instead of using the LS9130 storage mode, you can use the following functions to interact with the [Text Data Mode] property in the [System Settings], [Device/PLC] page.
_CF_dir() CF file operation: Output file list
_SD_dir() SD file operation: Output file list
_USB_dir() USB file operation: Output file list
Mode 0
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)
When the device address length is 16 bits
When the device address length is 32 bits
Mode 1
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)
When the device address length is 16 bits
When the device address length is 32 bits
Mode 2
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)
When the device address length is 16 bits
When the device address length is 32 bits
Mode 3
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)
When the device address length is 16 bits
When the device address length is 32 bits
The data storage mode for scripts is not the same as the string data mode in the [System Settings], [Device/PLC] page. A comparison of the data storage mode and the string data mode is shown below.
Data in Device Addresses |
LH/HL Storage |
Double-word Byte LH/HL storage order |
D-Script data storage mode |
Text Data Mode |
---|---|---|---|---|
Store from Start Data |
HL Order |
HL Order |
0 |
1 |
LH Order |
1 |
2 |
||
HL Order |
LH Order |
2 |
5 |
|
LH Order |
3 |
4 |
||
Store from Last Data |
HL Order |
HL Order |
- |
3 |
LH Order |
- |
7 |
||
HL Order |
LH Order |
- |
8 |
|
LH Order |
- |
6 |