S7-1200 Programmable controller
System Manual, 03/2014, A5E02486680-AG
775
Teleservice communication (SMTP email)
TM_Mail (Send email) instruction
Table 13- 1 TM_MAIL instruction
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 email
message using the SMTP (Simple Mail
Transfer Protocol) over TCP/IP via the
CPU Industrial Ethernet connection. Where
Ethernet-based Internet connectivity is not
available, an optional Teleservice adapter
can be used for connection with telephone
land lines. TM_MAIL executes
asynchronously and the job extends over
multiple TM_MAIL calls. When you call
TM_MAIL, you must assign an instance
DB.
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 email 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, so you can detect state changes in
subsequent program execution cycles.
Table 13- 2 Interaction of the Done, Busy and Error parameters
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.