FP
Σ
Communication Function 2 General-purpose Serial Communication
9 - 12
9.2.2
Receiving Data from External Device
Overview of data reception
FP
Σ
Data register (DT)
Device with
RS232C port
Data receiving
Reception done flag: on
Figure 175: FP
Σ
Data reception
Data input from the COM. port is stored in the received buffer specified by the system
register, and the “Reception done” flag goes on.
If the “Reception done” flag is off, data can be received at any time.
Sample program for data reception
Data “10 byte” received in the received buffer through the COM.1 port is read to DT0.
Preparing to receive the next data
To prepare to receive the next data, the
F159
instruction resets the buffer writing point and
turns off the reception done contact “R9038”,
based on the empty data.
Retrieving received data
The received data in the received buffer is read
from the area in which it is stored (from DT201 )
and sent to DT0.
Reception done detection
The internal relay (R10) is turned on at the
reception done contact “R9038” timing.
Starting from DT100
The contents of the four words
from DT201 to DT204
are written to data registers DT0 to DT4.
the contents of 0 bytes
are sent from the COM.1 (K1) port.
R9038
F10 BKMV ,DT201 , DT204
,DT0
F159 MTRN ,DT100
,K0
, K1
R10
DF
R10
R10
Figure 176: FP
Σ
Sample program for data reception
The program described above is executed in the following sequence.
1.
Data is received from the RS232C device to the received buffer.
2.
The reception done contact “R9038 (R9048)” is turned on.
3.
The received data is sent from the received buffer to the area starting
with the data register DT0.
4.
The
F159 (MTRN)
instruction based on the empty data is executed,
which resets the buffer writing point and turns off the reception done
contact “R9038 (R9048)”.
The system is then ready to receive the next data.
Summary of Contents for FP Series
Page 15: ...FP Functions and Restrictions of the Unit 1 2...
Page 25: ...FP Specifications and Functions of Control Unit 2 2...
Page 37: ...FP Expansion 3 2...
Page 44: ...Chapter 4 I O Allocation 4 1 I O Allocation 4 3...
Page 45: ...FP I O Allocation 4 2...
Page 51: ...FP Installation and Wiring 5 2...
Page 77: ...FP High speed Counter and Pulse Output Functions 6 2...
Page 133: ...FP High speed Counter and Pulse Output Functions 6 58...
Page 135: ...FP Communication Cassette 7 2...
Page 147: ...FP Communication Function 1 Computer Link 8 2...
Page 169: ...FP Communication Function 2 General purpose Serial Communication 9 2...
Page 205: ...FP Communication Function 2 General purpose Serial Communication 9 38...
Page 207: ...FP Communication Function 3 PLC Link Function 10 2...
Page 232: ...Chapter 11 Other Functions 11 1 Analog Potentiometer 11 3 11 2 Clock Calendar Function 11 4...
Page 233: ...FP Other Functions 11 2...
Page 239: ...FP Self Diagnostic and Troubleshooting 12 2...
Page 249: ...FP Self Diagnostic and Troubleshooting 12 12...
Page 251: ...FP Specifications 13 2...
Page 323: ...Index FP I 4...
Page 325: ...FP Record of changes R 2...