220
5 MODULE DEDICATED INSTRUCTION
5.4 Network Dedicated Instruction
Program example
• The following program performs the e-mail receiving process by the receive instruction (X21).
(The I/O signals of the Ethernet module are X/Y00 to X/Y1F)
Request
(read)
• E-mail read processing from the mail server is performed.
• After the execution of the MRECV instruction, inquiry (read) processing for information
on the received mails remaining in the mail server is performed. (Inquiry for receiving
of a mail is made immediately.)
Received mails
stored in the mail
server can be read
in series.
Inquiries to the mail
server are made more
often.
Internal processing of
the module increases,
which affects other
internal processing to a
certain degree.
[Structured ladder/FBD]
[ST]
IF (X21=TRUE) THEN
SET(TRUE,Var_Flag_Exe);
END_IF;
IF((Var_Flag_Exe=TRUE) AND (U0\G9858.F=TRUE))THEN
MOVP(TRUE,H200,Var_ControlData[0]); (* Sets to inquire to server *)
MOVP(TRUE,0,Var_ControlData[2]); (* Sets to read the first mail *)
MOVP(TRUE,0,Var_ControlData[9]); (* Sets to adjust data length to that of the received mail *)
MOVP(TRUE,0,Var_ControlData[10]); (* Sets to adjust header data length to that of the received mail *)
ZP_MRECV(TRUE,"00",Var_ControlData,D100,Var_Result); (* Reads received e-mail *)
RST(TRUE,Var_Flag_Exe);
END_IF;
IF(Var_Result[0]=TRUE)THEN (* Execution finished *)
IF(Var_Result[1]=FALSE)THEN (* Normal completion *)
ELSE (* Error completion *)
END_IF;
END_IF;
Setting option
Processing
Advantage
Disadvantage
Sets
to
read
the
f
i
rst
m
a
il
Sets
to
ad
j
ust
data
l
ength
to
that
of
the
rece
iv
ed
m
a
il
Sets
to
ad
j
ust
header
data
l
ength
to
that
of
the
rece
iv
ed
m
a
il
Sets
to
i
n
q
u
i
re
to
ser
v
er
R
eads
rece
iv
ed
e
-m
a
il
N
or
m
a
l
co
mpl
et
i
on
E
rror
co
mpl
et
i
on
P
rocess
on
nor
m
a
l
co
mpl
et
i
on
P
rocess
on
error
co
mpl
et
i
on
(
* P
rocess
on
nor
m
a
l
co
mpl
et
i
on
*
)
(
* P
rocess
on
error
co
mpl
et
i
on
*
)
Содержание MELSEC System Q
Страница 1: ...MELSEC Q L Structured Programming Manual Special Instructions ...
Страница 2: ......
Страница 307: ...10 SFC CONTROL INSTRUCTION 10 2 SFC Transition Condition Comment Read 305 10 MEMO ...
Страница 309: ...I 307 MEMO ...
Страница 315: ......