635
SP.FWRITE
1
2
3
4
4
6
7
8
7.18
Ot
her inst
ructions
7.18.1
2
SP.FWRIT
E
(i)
Below is the method for calculating the file size (total number of bytes) when a CSV format file is written to the ATA
card.
Total number of bytes = Total bytes excluding final line + bytes of final line
(Number of bytes on a line = number of columns
*1
+ 1 + total bytes of all data values on line
*2
)
*1:
For all lines but the final line, this is the specified number of columns. The number of columns on the final line depends on the
number of columns specified via the amount of data written. It is calculated as follows.
(1) The number of lines excluding the final line is calculated.
Number of lines excluding final line = Amount of data in write r number of columns (remainders discarded)
(2) The number of columns in the final line is calculated.
Number of columns in final line = Amount of data in write request - number of lines excluding final line number of columns)
*2:
The number of bytes for each data value is calculated as shown below.
Operat
i
on
E
rror
(1) In any of the following cases, an operation error occurs, the error flag (SM0) turns ON, and an error code is stored into
SD0.
Sign of Data
Value
Bytes per Data Value
Byte Count Range
Examples
Positive
Num. digits
1 to 5 (word specified)
1 to 3 (byte specified)
12345: 5 bytes
67: 2 bytes
Negative
Num. 1
2 to 6 (word specified)
2 to 4 (byte specified)
-12345: 6 bytes
-67: 3 bytes
Error
code
Error details
Q00J/
Q00/
Q01
QnH
QnPH QnPRH
QnU
LCPU
4004
The device that cannot be specified has been specified.
––
4100
Values specified in control data ( ) and the subsequent devices are
out of the setting range.
No space is found when a new file is created.
A value that cannot be used has been set for the file name ( ).
The attribute of the file name ( ) is "read only".
––
The drive specified by drive designation device ( ) contains the
medium other than the ATA card.
Space in the ATA card is insufficient.
An access error occurred in the ATA card.
––
––
The drive specified by drive designation device ( ) contains the
medium other than the SD Memory card.
Space in the SD Memory card is insufficient.
An access error occurred in the SD Memory card.
––
––
––
––
––
4101
The value specified in "No. of request write data" ( ) is out of the
setting range, or exceeds the device range specified in ( +1) or the
subsequent devices.
––
The range of the device specified in or exceeds that of the
corresponding device.
––
––
––
––
D0
S1
S1
S0
S0
S2
S2
D0
D1