Sending Email via the SEND_REQ Block
(Original Document)
Using SEND_REQ to Send Pre-configured Email Messages
Use the SEND_REQ block in your application to programmatically send any of three email messages you previously configured in Control Expert.
NOTE: To successfully send an Email message using the SEND_REQ block, synchronize the SMTP service and PLC application—i.e., activate the SMTP service whenever the PLC is in RUN mode.
FBD Representation
Input Parameters
The following table describes the input parameters:
Parameter
Data type
Description
ADR
Array [0...5] of INT
The path to the destination device, which has an addresses ending in SYS; for example, rack.slot.channel.SYS.
Use the EF ADDR to convert from the string format to the array of INT. For example, if the module is configured at rack 0, slot 4, channel 0, use: ADDR(‘0.4.0.SYS’).
CODE
INT
Use the request code 0x37 (write Object) to send the SMTP request to the TSX ETC 101 Ethernet communication module.
EMIS
Array [n...m] of INT
Character string to be sent. The maximum length of data to send is 246 bytes. Refer to the following description of the EMIS parameter structure.
The EMIS parameter contains the character string to be sent
EMIS Description
Value
Byte
Word
Category
0x96
0 (low byte)
0
Segment
0x15
1 (high byte)
Type
0
2 (low byte)
1
Reserved byte 1
0
3 (high byte)
Reserved byte 2
0
4 (low byt)e
2
Number of characters (n1) starting with the following byte (i.e. Mail header number)
n1                         (must be ≤240)
5 (high byte)
Mail header number
1, 2, 3
6 (low byte
3
Number of characters (n2) to be added to the email subject line
n2                        (must be ≤(n1–2))
7 (high byte)
n2 characters added to email subject line1
<user defined>
8...245 (max)
4...122 (max) (= (n1–2)/2)
Body of email message1, 2
<user defined>
1 
The following (n1– 2)/2 words (up to a maximum of 119)) contain the data in ASCII format that will be copied into the email message. The first n2 characters are added to the configured email subject and the rest are part of the email body:
2 
Use the $N (or $n) two-character tag to insert a line break in the email text.
Input/Output Parameters
The following table describes the GEST management parameter, which is the only input/output parameter:
Parameter
Data type
Description
GEST
Array [0...3] of INT
The management parameter, consisting of 4 words.
The GEST management parameter presents the following structure:
Description
Word Order
MSB
LSB
System-managed data
1
Exchange number
Activity bit—the first bit of the first word. It indicates the execution status of the communication:
  • 1 = Email is being sent
  • 0 = Email complete
2
User-managed data
3
Timeout
4
Length: the size of the data buffer.
Output Parameters
The following table describes the RECP received data parameter, which is the only output parameter:
Parameter
Data type
Description
RECP
Array [n...m] of INT
The request does not return data.