7 APPLICATION INSTRUCTIONS
7.6 Reading/Writing Data Instructions
617
7
■Applicable devices
■For RnCPU (firmware version "28" or later) and RnENCPU (firmware version "28" or later)
• Control data (d1)
Operand Bit Word Double word Indirect
specification
Constant Others
(U)
X, Y, M, L,
SM, F, B, SB,
FX, FY
J\ T, ST, C, D, W,
SD, SW, FD, R,
ZR, RD
U\G, J\,
U3E\(H)G
Z LT, LST,
LC
LZ K, H E $
(U)
(s1)
(d1)
(s2)
(s3)
(d2)
Operand: (d1)
Device Item Description Setting range Set by
+0 Execution/completion
type
Specify the execution type.
■00**H: Writing binary data
• 0000H: 16-bit binary data
• 0001H: 32-bit binary data
■01**H: Writing data after converted to CSV format
• 0100H: Decimal (signed 16-bit data)
• 0101H: Decimal (unsigned 16-bit data)
• 0110H: Decimal (signed 32-bit data)
• 0111H: Decimal (unsigned 32-bit data)
• 0120H: Hexadecimal (16-bit data)
• 0121H: Hexadecimal (32-bit data)
• 0130H: String (ASCII data)
• 0140H: Floating point real number (single-precision real number)
• 0141H: Floating point real number (double-precision real number)
0000H
0001H
0100H
0101H
0110H
0111H
0120H
0121H
0130H
0140H
0141H
User
+1 Completion status The completion status is stored upon completion of the instruction.
• 0000H: Completed successfully
• Other than 0000H: Completed with an error (error code)
System
+2 Number of data actually
written
For the data in the device specified by (s3), the number of data actually written is
stored.
The data unit is determined by (d1)+7 (Data type specification).
System
+3 Not used
+4
+5
File position ■When "Writing binary data" is specified by (d1)+0
• 00000000H: From the beginning of the file
• 00000001H to FFFFFFFEH: From the specified position (The data unit is
determined by (d1)+7.)
• FFFFFFFFH: Added to the end of the file.
■When "Converting and writing data in CSV format" is specified by (d1)+0
• 00000000H to FFFFFFFEH: From the beginning of the file
• FFFFFFFFH: Added to the end of the file.
00000000H to
FFFFFFFFH
User
+6 Number of columns When "Writing binary data" is specified by (d1)+0, set 0.
When "Converting and writing data in CSV format" is specified by (d1)+0, specify the
number of columns to write.
• 0: No column (Regarded as one row.)
• Other than 0: Number of specified columns
0000H to FFFFH
(0 to 65535)
User
+7 Data type specification • 0: Word
•1: Byte
• 2: Unit of the data type specified by (d1)+0
"0: Word" and "1: Byte" can be specified only when "0000H: 16-bit binary data" or
"0100H: Decimal (signed 16-bit data)" is specified by (d1)+0.
0, 1, 2 User