626
7 APPLICATION INSTRUCTIONS
7.6 Reading/Writing Data Instructions
• An integral multiple of "Number of columns" should be specified for "Number of request write data".
Otherwise, numbers of columns will be apart.
• The last data is always followed by a line feed code. In addition mode, therefore, data is added starting from
the beginning of a new line.
• When data is added to the end of a file, columns are shifted if "Number of columns" is changed from the
previous writing.
• The following figures show an example of specifying "String (ASCII data)" for the execution/completion type.
Writing data after converted to CSV format (string (ASCII data))
• Set 00H (NULL) in the end of the string in an element. When the number of bytes of the string is even, set
0000H (two bytes of NULL) in the next one word.
• The maximum number of characters in one element is 1999. If this maximum number is exceeded and 00H
(NULL) is not stored, characters of 2000th character and after are not written and the write processing shifts
to the next element.
• A maximum of 1023 elements can be written in a single instruction execution.
[Data to be written to a file] (1) Data to be written
(2) File name
(3) Control data
[Control data] D10: Execution/completion type: String (ASCII data)
D11: Completion status
D12: Number of data actually written
D13: (Not used)
D14, D15: File position
D16: Number of columns
D17: Data type specification
D99: Number of request write data
D100 to D102: String to be written to the 1st column of
the 1st line
D103, D104: String to be written to the 2nd column of
the 1st line
D105, D106: String to be written to the 3rd column of
the 1st line
SP.FWRITE
D10
K2
U0 "ABCD" D99
M0
(1)
(2)
(3)
H0130D10
H0000D11
-D12
-D13
K0
D14
D15
K0D16
K2D17
ABCD.CSV ABCD 123, 456, CR LF
K3D099
H4241D100
H4443D101
H0000D102
H3231D103
H0033D104
H3534D105
H0036
D106
"ABCD"
"123"
"456"