Chapter 7 Automatic Sending/Receiving function (ASR)
Sample program 3
To open the connection to other station
Slot No.
0 1
2
(for EH-CPU)
EH-ETH2
* -
-
FUN201 for reading out SR
FUN201 (WM000)
(00003)
(00001)
WM003 = H2
WM004 = H2F
ADRIO = (WM005, R100)
ADRIO = (WM006, WM10)
WM007 = 13
R100 = 1
(00002)
R100
S
Reading out SR at R100 = 1
R100
Parameter area setting of FUN201(s) for reading out
SR
*1
.
Request to read out SR
Area setting (unit:0, slot:0)
Control bit address is R100
Transmission I/O address is starting from WM10
Transmission data size is 13 words
Setting 1 to control bit for reading SR.
R7E3
(00004)
R2
Request to open connection 1 at R1 = 1.
Check status (M170) and error (M110) of
connection 1
R1
M170
M110
Set 1 to “request to open bit” of connection 1.
Set 1 to “request to write to CR
*2
bit”
Set 0 to “request to open contact” (R1).
Enable the circuit for cancellation the request to open.
(00006)
M210 = 1
R103 = 1
R1 = 0
R3 = 1
R2
(00010)
R7E3
WM00B = H3
WM00C = H0
ADRIO = (WM00D, R103)
ADRIO = (WM00E, WM20)
WM00F = 10
FUN201 (WM008)
(00011)
Parameter area setting of FUN201(s) for writing CR.
Request to write CR.
Area setting (unit:0, slot:0)
Control bit address is R103.
Transmission I/O address is starting from WM20.
Transmission data size is 10 words.
FUN 201 for writing CR.
R2
R1 = 0
(00005)
(00007)
TD1
Timer counting from the request to open.
R3
0.1
10
(00008)
R4
Set 1 to R4 if the connection is not opened after 1
second.
TD1
M170
Clear “request to open bit” for connection 1.
Set 1 to “request to write CR bit”.
Disable the circuit for cancellation the request to open.
(00009)
R3
M170
M210
R4
M210 = 0
R103 = 1
R3 = 0
Cancellation the connection open if connection 1 is
open (M170=1) or error (M110=1).
M210
*1: SR is abbreviation of Status Register
*2: CR is abbreviation of Control Register.
See "Chapter 8 Register Structure" for detailed.
7-8