Sample Programs
FP2 Serial Data Unit
8 − 5
8.1 Sample Programs
8.1.1.2 BCC Automatic Addition Sent Program
In this program, when a command is set in a data register and X20 is turned on, the BCC
is added automatically after the command, and the data is sent.
DT0: Address at which command is stored
DT1: Number of command bytes (excluding BCC)
For this program, the serial data unit should be installed in slot 0.
X1
, K0 , K251 , K7 , DT200
F150 READ
X20
R0
DF
, K0 , I0DT0 , I1K 0 , K1
R0
R0 Y10
F151 WRT
R0
M %01#RDD00100 , DT100
F95 ASC ,
, K 17 , DT1
F0 MV
X0
Y10
M 00101⊔⊔⊔⊔⊔⊔⊔ , DT106
F95 ASC ,
, H 0 , DT108
F6 DGT
, H 210
, H 0 , DT109
F0 MV
, K 100 , DT0
F0 MV
R0
(CALL 0)
DF
Specifies the FP2 serial data
unit in slot no.0.
Internal relay (R0) is turned on at
timing of send condition (X20).
Commands are stored.
Command storage address
Number of command bytes
BCC creation routine call
Data is written to address 1 of
shared memory (sent buffer of CH1).
After sending has begun, the send-
ing directive continues until sending
has been completed.
Data is read from address 251 of the
shared memory (received buffer of
CH1) at the timing of the reception
completed flag (X1).
is written to the shared memory address 1.
Specifies the FP2 serial data
unit in slot no.0.
is read to the data register DT200 to DT206.
The contents of 7−word of shared memory
address 251 to 257
Starting with the data register indicated by I0.
The word content specified by I1
next page