Sending process messages by email
8.4 Sending an e-mail
Configuring and commissioning S7 CPs for Industrial Ethernet
142 Configuration Manual, 09/2013, C79000-G8976-C182-13
● Structure and syntax of the data in the email DB
The structure suggested here with multiple STRINGs is one of several variants. Crucial
are the entries in the column "Initial value" with the IDs contained therein (TO:, SUB:,
CC:, FROM:, TXT:, BNY:) which must be used in the DB in precisely this notation to
identify the mail content! All entries must end with a semicolon; only the last entry does
not need a semicolon.
The string length is only shown in the table as an example; it can be customized to the
actual character count (exception: The string length for identifying the attachment must
be specified with [4]).
For example, another variant would be using only one STRING in total, and assigning the
entire text to this string with the identifiers.
● If you encounter a problem entering the "@" symbol, try the input ALT+64 instead.
● Attachments
The user data entered in the email DB can also be delivered to the recipient entirely or
partially as attachment. For this the sender must give the data the identifier "BNY:" .
The data specified after this identifier will then be delivered to the recipient as attachment.
In the table the attachment is 2 bytes; this is only an example however. You can enter
attachments that are as complex as you like.
● Data length
The data length specified in the call AG_SEND/AG_LSEND must at least include the
length of the data in the DB; note the specifications in the address column of the
programming editor (Note: The specification corresponds to the number of bytes).
Sending an email with AG_SEND/AG_LSEND
1)
Use the FC AG_SEND program block to send an e-mail or with data lengths >240 bytes, use
AG_LSEND. A detailed description of call parameters is available in the online help for the
program blocks.
See also /10/ (Page 230)
Example:
//Connection ID (connection configuration)
LADDR := W#16#0100 //Module address 256Dec. in hardware
SEND := P#db99.dbx10.0 byte 278,
//Address of the data block; DB length
//Length of the data range to be sent
//Address for return parameter DONE
//Address for return parameter ERROR
//Address for return parameter STATUS