FP
Σ
9.3 Connection Example with External Devices
9 - 21
Sample program
In the following example, the Micro-Imagechecker is connected to the COM. 1 port.
R0
DF
R10
F95 ASC ,
R10
M %S
, DT101
F159 MTRN , DT 100
, K2
, K1
R9038
DF
, D201 , DT204
, DT0
R11
F10 BKMV
R11
R11
, DT 100
, K0
, K1
F159 MTRN
Transmission
Reception
Data transmission command
The internal relay “R10” is turned on at the
timing of the transmission condition “R0”.
Data conversion
The start command “%S” character is con-
verted to ASCII code, and written to DT101 to
DT106.
Data transmission
The data in the transmission buffer is sent
from the COM. 1 port
Reception done detection
The internal relay “R11” is turned on at the
reception done contact “R9038” timing.
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.
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.
Ten spaces inserted
With DT100 as the transmission buffer
the contents consisting of two bytes of it
are sent from COM. 1 (K1) port.
Starting from DT100
the contents of 0 bytes
are sent from the COM. 1 (K1) port.
The 4-word contents from DT201 to DT204
are written to data registers DT0 to DT3.
Figure 185: FP
Σ
Sample program (for micro-imagechecker)
The various buffer statuses
The following shows the statuses of the send and received buffers when the sample
program is run.
Transmission buffer
Number of
bytes to be
transmitted
(Statuses before
transmission)
DT100
DT101
K2
H53 (S)
DT204
H25 (%)
DT200
DT201
DT202
DT203
Reception buffer
K7
Received
number of
bytes
Received data is
stored in order from
the lower-order byte.
H30 (0)
H31 (1)
H32 (2)
H31 (1)
H34 (4)
H33 (3)
H35 (5)
(Statuses when
reception is completed)
Figure 186: FP
Σ
Various buffer statuses
Содержание FP Series
Страница 15: ...FP Functions and Restrictions of the Unit 1 2...
Страница 25: ...FP Specifications and Functions of Control Unit 2 2...
Страница 37: ...FP Expansion 3 2...
Страница 44: ...Chapter 4 I O Allocation 4 1 I O Allocation 4 3...
Страница 45: ...FP I O Allocation 4 2...
Страница 51: ...FP Installation and Wiring 5 2...
Страница 77: ...FP High speed Counter and Pulse Output Functions 6 2...
Страница 133: ...FP High speed Counter and Pulse Output Functions 6 58...
Страница 135: ...FP Communication Cassette 7 2...
Страница 147: ...FP Communication Function 1 Computer Link 8 2...
Страница 169: ...FP Communication Function 2 General purpose Serial Communication 9 2...
Страница 205: ...FP Communication Function 2 General purpose Serial Communication 9 38...
Страница 207: ...FP Communication Function 3 PLC Link Function 10 2...
Страница 232: ...Chapter 11 Other Functions 11 1 Analog Potentiometer 11 3 11 2 Clock Calendar Function 11 4...
Страница 233: ...FP Other Functions 11 2...
Страница 238: ...Chapter 12 Self Diagnostic and Troubleshooting 12 1 Self Diagnostic Function 12 3 12 2 Troubleshooting 12 5...
Страница 239: ...FP Self Diagnostic and Troubleshooting 12 2...
Страница 249: ...FP Self Diagnostic and Troubleshooting 12 12...
Страница 251: ...FP Specifications 13 2...
Страница 323: ...Index FP I 4...
Страница 325: ...FP Record of changes R 2...