S7-1200 Programmable controller
System Manual, 11/2011, A5E02486680-05
627
Teleservice communication (SMTP e-mail)
13
13.1
TM_Mail transfer e-mail instruction
Table 13- 1 TM_MAIL instruction
LAD / FBD
SCL
Description
"TM_MAIL_DB"(
REQ:=_bool_in_,
ID:=_int_in_,
TO_S:=_string_in_,
CC:=_string_in_,
SUBJECT:=_string_in_,
TEXT:= _string_in_,
ATTACHMENT:=_variant_in_,
BUSY=>_bool_out_,
DONE=>_bool_out_,
ERROR=>_bool_out_,
STATUS=>_word_out_,);
The TM_MAIL instruction sends an
e-mail message using the SMTP
(Simple Mail Transfer Protocol) via a
CPU Industrial Ethernet connection
to the optional teleservice adapter.
TM_MAIL executes asynchronously
and the job extends over multiple
TM_MAIL calls.
When you call TM_MAIL, you must
specify an instance DB. The
instance DB retentive attribute must
not be set. This ensures that the
instance DB is initialized in the
transition of the CPU from STOP to
RUN and that a new TM_MAIL
operation can be triggered.
1
STEP 7 automatically creates the instance DB when you insert the instruction.
You start sending an e-mail with a positive edge change from 0 to 1, at input parameter
REQ. The following table shows the relationship between BUSY, DONE and ERROR. You
can monitor the progress of TM_MAIL execution and detect completion, by evaluating these
parameters in successive calls.
The output parameters DONE, ERROR, STATUS, and SFC_STATUS are valid for only one
cycle, when the state of the output parameter BUSY changes from 1 to 0. Your program
logic must save temporary output state values in data latches, so you can detect state
changes in subsequent program execution cycles.
Table 13- 2 Interaction of the Done, Busy and Error parameters
DONE
BUSY
ERROR
Description
Irrelevant
1
Irrelevant
Job is in progress.
1
0
0
The job was completed successfully.
0
0
1
The job was terminated with an error. For the cause of the error, refer to the
STATUS parameter.
0
0
0
No job in progress