NAiS FP Series User Manual page 193

Applicable plc
Hide thumbs Also See for FP Series:
Table of Contents

Advertisement

Communication Function 2 General - purpose Serial Communication
Sample program
The following shows an example in which an FP series PLC is connected to the COM.
1 port.
R0
DF
R10
F95 ASC ,
F95 ASC ,
F159 MTRN , DT 100
With DT100 as the transmission buffer
the contents consisting of 19 bytes of it
R9038
DF
R11
F10 BKMV
The contents of 8 words from DT201 to DT208
R11
DF
R12
F72 AHEX
R11
F159 MTRN
Figure 191: FPΣ Sample program (for FP series PLC)
9 - 26
M %01#RDD00000 , DT101
M 00001**
Five spaces inserted
, K19
are sent from COM. 1 (K1) port.
, D201 , DT208
are written to data registers DT0 to DT7.
=, DT1, H2431
, DT3
, K8
, DT 100
, K0
Starting from DT100
the contents consisting of 0 bytes
are sent from the COM. 1 (K1) port.
R10
Data transmission command
The internal relay "R10" is turned on at the
timing of the transmission condition "R0".
Data conversion
"%01#RDD00000" is converted to ASCII
code, and written to DT101 to DT106.
, DT107
"00001**" is converted to ASCII code, and
written to DT107 to DT112.
, K1
Data transmission
The data in the transmission buffer is sent
from the COM. 1 port
R11
Reception done detection
The internal relay "R11" is turned on at the
reception done contact "R9038" timing.
, DT0
Retrieving received data
The received data in the received buffer is
read from the area in which it is stored
(DT201 to ) and sent to DT0.
R12
Check of received data
To determine whether the received data is
a normal response, the comparison in-
struction is used to check whether the
character string "1$" is stored in DT1.
Check of received data
, DT50
The eight- character ASCII code beginning
with DT3 is converted to a hexadecimal
value and stored in DT50 and DT51.
, K1
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 con-
tact "R9038", based on the empty data.
FPΣ

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Fps seriesFpg-c32tFpg-c32t2Fpg-c24r2

Table of Contents