4. Con el terminal CPX para Ethernet
Ejemplo
STEP
"" Set user name and mail host
IF
NOP
THEN
CMP 30
WITH V1
WITH V10
WITH V11
IF
FU32
= V0
THEN
NOP
STEP
"" Send e–mail
IF
NOP
THEN
CMP 30
WITH V2
WITH V12
WITH V13
WITH V14
WITH V2
IF
FU32
= V0
THEN
NOP
STEP
"" Wait until E–mail is sent
IF
NOP
THEN
CMP 30
WITH V0
WITH V20
IF
FU32
= V0
THEN
LOAD FU34
TO FW34
LOAD FU35
TO FW35
4−20
En el siguiente extracto de programa, primero se definen el
nombre de usuario y el mail host y luego se envía el e−mail.
'E–MAIL module
"1:set name and mail host
"string#10: user name
"string#11: mail host
'Parameter 1
'E–MAIL module
"2 send mail
"string#12: Target address
"string#13: Re:
"string#14: Mail text
"Number of strings with mail text (here 2)
'Parameter 1
'E–MAIL module
"0:Status interrogation
"string#20: Reply from mail host
'Parameter 2
'Parameter 3
'SMTP fault code
'Parameter 4
'SMTP additional fault code
Festo P.BE−CPX−FEC−ES es 0404NH