631
SP.FWRITE
1
2
3
4
4
6
7
8
7.18
Ot
her inst
ructions
7.18.1
2
SP.FWRIT
E
(3) Be sure to use in units of words to designate the No. of request write data ( ) and the file position ( +4 and +5).
The following shows the method for writing binary data when No. of request write data and file position are specified.
(4) When writing binary data
(a) If the extension of the target file is omitted, ".BIN" is used as an extension.
(b) When the designated file does not exist, a new file is created and the data is saved from the beginning of the file.
The attributes of this new file are set using the archive attributes.
(c) When the designated file exists, the data is saved from the beginning of the file.
When the size of the data exceeds that of the existing area in the file during the writing, the excess data is added/
saved.
(d) If the file position specified is greater than the existing file size:
• The High Performance model QCPU of which the first 5 digits of the serial number are "01111" or lower results in
an error.
• The High Performance model QCPU/Process CPU/Redundant CPU/Universal model QCPU/LCPU of which the
first 5 digits of the serial number are "01112" or higher performs writing at point 0 and is completed normally.
(e) An error occurs when the saving space becomes full while data is added and saved.
In such a case, the data that is successfully added/saved remains in the medium.
The error completion is indicated after as much data as possible is added/saved.
(5) When writing data after CSV format conversion
(a) If the extension is omitted, ".CSV" is used as an extension.
(b) When the existing file is specified:
[High Performance model QCPU of which the first 5 digits of the serial number are "01111" or lower]
File contents are all deleted and data are saved, starting at the beginning.
[High Performance model QCPU/Process CPU/Redundant CPU/Universal model QCPU/LCPU of which the first 5
digits of the serial number are "01112" or higher]
• When other than FFFFFFFF
H
is set at ( +4, +5), file contents are all deleted and data are saved, starting at
the beginning.
• When FFFFFFFF
H
is set at ( +4, +5), data are saved, starting at the end of the file.
S2
D0
D0
H
ead
pos
i
t
i
on
of
the
f
il
e
to
be
w
r
i
tten
Contro
l
data
H
0000
-
K
3
D0
+
0
D0
+
1
D0
+
2
D0
+
3
D0
+4
D0
+
5
D0
+
6
D0
+
7
K
1
K
0
K
0
-
E
xecut
i
on
/
comp
l
et
i
on
type
(
N
ot
used)
Wr
i
t
i
ng
resu
l
t
(
N
o
.
of
w
r
i
tten
data)
(
N
ot
used)
N
o
.
of
co
l
umns
des
i
gnat
i
on
Data
type
spec
i
f
i
cat
i
on
H
00
Fil
e
data
(
i
n
byte
un
i
tes)
One
w
ord
sh
i
ft
S2
+
0
H
00
H
22
H
33
H44
H
55
H
66
H
77
H
00
H
00
H
00
Data
de
vi
ce
S2
+
1
S2
+
2
S2
+
3
K
3
H
33 22
H
55
44
H
77 66
Data
to
be
w
r
i
tten
T
ota
l
D0
D0
D0
D0