Specifications

sigmadue - IEC 61131-3 Function Block Library
170
5-3-37 SEND_EMAIL
FB Prototype
SEND_EMAIL
Input parameters
Output parameters
Description
This function block implements the functions used by an e-mail client to establish
a connection with a SMTP server in order to send an e-mail message.
ENABLE/CONFIRM Management
The communication between an SMTP Client and Server is established on a TCP/
IP connection by exchanging some messages in a standardized sequence. The
time needed to realize and complete the sequence depends from some factors as
the connection speed, the server answering time, the functions supported by the
server and the dimension of the inputs. To avoid delays in the PLC program
execution cycle time, the function block is designed to execute the sequence of
activities cyclically with the FB “calls”. For these reasons it is important to define
the different synchronization mechanisms to control:
- when to start sending the message;
- when the sending process ended correctly;
- when a problem occurred during the process;
- when to abort the operations.
The parameters ENABLE and CONFIRM provide the correct functionalities in
order to manage these situations. The FB does not execute any operations until
the input ENABLE change to TRUE, then the process goes on until the output
CONFIRM become TRUE. At this point, it is necessary to call at least one time the
FB with the input ENABLE at FALSE in order to reset the sending sequence and
to be ready to send a new message. At any time, it is possible to reset the
message sending procedure by changing the ENABLE input value to FALSE.
Input Type Description
ENABLE BOOL Command to enable the operations
SERVER_ADDR STRING SMTP server address (45)
PORT UINT SMTP server connection port
USER_NAME STRING User name for the mail account (32)
PASSWORD STRING Password for the mail account (32)
TIME_DATE STRING Email sending date and time (20)
MAIL_FROM STRING Sender name (45)
RCPT_TO STRING Receiver addresses (250)
SUBJECT STRING Message subject (250)
MESSAGE STRING Message text (250)
Output Type Description
CONFIRM BOOL Confirm of the operation
ERR_CODE UINT Error code
ENABLE
SERVER_ADDR
PORT
USER_NAME
PASSWORD
TIME_DATE
MAIL_FROM
RCPT_TO
SUBJECT
MESSAGE
BOOL
STRING(45)
UINT
STRING(32)
STRING(32)
STRING(20)
STRING(45)
STRING(250)
STRING(250)
STRING(250)
¡
¡
¡
¡
¡
¡
¡
¡
¡
¡
BOOL
UINT
CONFIRM
ERR_CODE
¡
¡