Industrial Automation Tech Note 45 - TNIA45
This document describes configuring the Crimson® Mail Manager to send email and Short
Message Service (SMS) messages, as well as to receive SMS messages. All of the mail server
settings mentioned are real-world servers, user names, and passwords that may be used by Red
Lion Controls (RLC) customers for testing purposes.
Email via a Secure Connection (SSL/TSL or STARTTLS): CR3000 Human Machine Interface
(HMI), Graphite® Controller, and Graphite HMIs
Email via an Unsecure Connection: CR3000 HMI, Data Station Plus (DSP) (except LE model), G3
HMI, Graphite Controller, Graphite HMIs, Modular Controller (except LE and V2 models), ProducTVity Station™ (PTV)
SMS Send/Receive: CR3000 HMI (with CRM000 CM CMOD0 000 module or external serial cellular
modem), DSP (except LE model, with XCHSPA00 expansion card or external serial cellular
modem), G3 HMI (with G3HSPA00 expansion card or external serial cellular modem), Graphite
Controller (with GMHSPA00 module or external serial cellular modem), Graphite HMIs (with
GMHSPA00 module or external serial cellular modem), Modular Controller (except LE and V2 models, with XCHSPA00 expansion card or external serial cellular modem), PTV (with XCHSPA00
an expansion card or external serial cellular modem)
Use Case: Sending Email & SMS
This document describes using Crimson to configure Red Lion devices to send email or SMS
messages, and to receive SMS messages.
Crimson 2.0, 3.0, or 3.1
Required Operating System:
Microsoft Windows 2000, or above
Crimson can be configured to send email messages when alarm conditions are present or when notifications need to be provided about other events within the system. These messages may be sent via SMS to cellular devices, or via Simple Mail Transport Protocol (SMTP) email to any device which accepts mail using standard Internet protocols.
NOTE: Crimson is not capable of receiving email messages.
Configure Network Connection
1. Referring to Figure 1, navigate to the Communications section.
2. Click Network in the Navigation Pane.
3. Click on the Ethernet 1 or Ethernet 2 tab, as applicable.
4. Select the appropriate selection for the Port Mode: parameter; Manual Configuration in this example.
a. Define the IP Address: parameter, as applicable.
b. Define the Network Mask: parameter, as applicable.
c. Define the Gateway: parameter, as applicable
5. Configure the DNS Settings parameters if a named mailed server will be used
6. Referring to Figure 2, enable TLS-SSL only if a secure connection is required, by performing the following:
a. Click on the TLS – SSL tab.
b. Set the Protocol Support parameter to Enabled under Settings.
c. Select the Certificate Source option.
NOTE: Providing a certificate is not required for a secure connection to be established. However, the default may or may not meet your application’s security requirements. Consult with your Information Technology department for security requirements.
Configure Mail Manager
Mail Manager is used to configure the mail transports and the email address book. The properties on the Mail tab are used to enable or disable the mail manager, and to provide a name for the device on which Crimson is running. This name will be used within email messages to identify the originator of the message. Applications typically use the name of the machine to which the device is attached or the name of the site that is being monitored.
1. Referring to Figure 3, click on Mail Manager in the Navigation Pane.
2. Set the Enable Mail Manager: option to Yes.
3. Define the Unit Name: Crimson Device in this example.
4. Click the Edit Contacts button; the List of Contacts popup shown in Figure 4 appears.
5. Referring to Figure 4, define the Names and Addresses of contacts to be added to Crimson’s address book. Each entry allows a display Name and an Address to be entered, together with an optional expression that will enable or disable email to that contact. The address should be in a format suitable for the required transport. For example, SMTP names should follow the usual name@domain format. SMS names should be entered as international-format telephone numbers without the leading plus sign (i.e., SMS contacts must contain only numbers and must begin with the country code).
6. Click OK.
Configure SMTP (Email)
The SMTP tab is used to configure the Simple Mail Transport Protocol. This is the standard protocol used to send email over the Internet or over other TCP/IP networks. SMTP addresses follow the familiar name@domain standard.
1. Referring to Figure 5, click on the SMTP tab.
2. Set the Transport Mode: parameter to Enabled.
3. Set the Server Selection: parameter, as applicable; Manual Configuration in this example.
4. Set the Server IP Address: mode from the drop down; Fixed Name in this example.
5. Set the IP address, server name, or use a tag as applicable; mail.authsmtp.com in this example.
6. Enter the Server Port Number; 25 in this example.
7. Enter the Domain Name: parameter, as applicable.
8. Click the Edit button next to the Reverse Path: parameter; the Edit the E-mail Address popup appears. This is the address where the email will come ‘from’; in the case of AuthSMTP, this address must be registered with the server.
a. Specify the Display Name: parameter; Red Lion Test in this example.
NOTE: When using an Office365 server, the Display Name must be contained in double quotes (e.g., “Your Display Name”).
b. Specify the E-mail Address: parameter; firstname.lastname@example.org in this example.
9. Click OK.
10.Set the Initial Timeout: parameter, as applicable; the default is acceptable for most applications.
11.Set the Record Log File: parameter to Disabled. Note that this parameter should only be set to Enabled for troubleshooting purposes and will also require a properly formatted memory card to be inserted in the unit.
12.Referring to Figure 6, select the appropriate SMTP Authentication Method: parameter; Digest in this example.
13.Enter the Username: parameter, as applicable.
14.Enter the Password: parameter, as applicable.
15.Set the Use Secure Connection: parameter as applicable; No in this example.
16.Set the Date Format: parameter, as applicable; Locale Default in this example.
Common Email Provider Settings
This section lists settings typical of commonly used email providers.
•Server Address: mail.authsmtp.com
•Username: your AuthSMTP user name
•Password: your AuthSMTP password
•Port: 23, 25, 26, 325, or 2525
Gmail SMTP Settings
•Server Address: smtp.gmail.com
•Username: Your full Gmail address (e.g. email@example.com)
•Password: Your Gmail password
•Port (TLS): 587
•Port (SSL): 465
•TLS/SSL required: yes
Yahoo SMTP Settings
•Server Address: smtp.mail.yahoo.com
•Username: Your full Yahoo address (e.g. firstname.lastname@example.org)
•Password: Your Yahoo password
•Port: 465 or 587
•Requires SSL: Yes
•Requires TLS: Yes (if available).
Outlook.com SMTP Settings
•Server Address: smtp-mail.outlook.com
•Username: Your full Outlook.com address (e.g. email@example.com)
•Password: Your Outlook.com password
•Requires STARTTLS: Yes.
This section lists the usernames and passwords for demo accounts maintained by RLC and available to RLC users when establishing and testing their email settings.
Add and Configure Cellular Modem
This section describes how to add and configure a cellular modem. Instructions are included for both Serial Modems and for Modem Modules/Option Cards.
1. Referring to Figure 7, navigate to the Communications section.
2. Add a cellular modem: if adding/configuring a Serial Modem, go to Step a; if adding/configuring a Modem Module or Option Card, go to step b.
a. To add/configure a Serial Modem:
1) Go to the Navigation Pane and click on the serial port to be connected to the modem; RS-232 Comms Port in this example. The Communications - RS-232 Comms Port window opens and the Driver Picker for Serial Port popup appears.
2) Click the Pick button next to the Driver: parameter.
3) Under the Manufacturer heading, select System.
4) Under the Driver heading, select PPP and Modem Client.
5) Click OK.
6) Referring to Figure 8, under the Connection heading, set the Connect Using: parameter to HSPA+ Modem.
7) Set the Connection Type: parameter to On-Demand.
8) Set the Manufacturer: parameter, as applicable; if the manufacturer is not listed choose Generic.
9) Set the Init String: and Additional Init: parameters so that the modem uses the following
settings (this will require referring to the modem’s documentation for details):
a. No echo
b. Verbal result codes
c. Normal carrier detect operation
d. DTR override
e. No Flow Control
f. Modem must ignore RTS
g. DSR override, always on
h. Auto answer disabled
i. Escape character set to 43 decimal
j. 500 millisecond guard time for the escape code sequence (+++)
k. Autobaud or 115.2K baud
10) Set the SMS Support: parameter to Enabled.
11) Set the Log File: parameter to Disabled; only enable for troubleshooting purposes.
12) Leave all other parameters set at factory default.
b. To add/configure a Modem Module or Option Card, refer to Figure 9 and perform the following:
1) Scroll to the bottom of the Navigation Pane.
2) Click on an available Comms Module Slot (or Option Card); Slot 1 in this example. The appropriate Communications - Comms Modules - Slot “X” screen and Module popup appear.
3) Click the Pick button next to the Module/Card: selection.
4) Select Cell Modem Module (or Option Card), as appropriate; Cell Modem Module in this example.
5) Click OK.
6) Referring to Figure 10, go to the Navigation Pane and click on the Modem Port entry that auto-populated under the Cell Modem.
7) Click the Pick button next to the Driver: parameter.
8) Under the Manufacturer heading, select.
9) Under the Driver heading, select PPP and Modem Client.
10) Click OK.
a. Referring to Figure 11, set the Connect Using: parameter to HSPA+ Modem.
b. Set the Connection Type: parameter to On-Demand.
c. Set the Location: parameter to the frequencies used where the application will be deployed; 850/1900 MHz in this example.
d. Set the SMS Support: parameter to Enabled.
e. Set the Log File: parameter to Disabled; select enable only for troubleshooting purposes.
f. Leave all other parameters set at factory default.
Configure Mail Manager
1. Referring to Figure 12, go to the Navigation Pane and click on Mail Manager.
2. Set the Enable Mail Manager: parameter to Yes.
3. Specify the Unit Name: parameter, as appropriate; Crimson Device in this example.
4. Click the Edit Contacts button; the List of Contacts screen shown in Figure 13 appears.
5. Referring to Figure 13, define the names and addresses for all contacts. SMS contacts must contain only numbers and must begin with the country code.
6. Click OK.
The SMS tab is used to configure the Short Message Service transport that is supported when using a Global System for Mobile communication/General Packet Radio Service modem in association with the target device.
1. Referring to Figure 14, click on the SMS tab.
2. Set the Transport Mode: parameter to Enabled.
3. Set the Message Relay: parameter, as desired. When it is enabled and an alarm occurs, an SMS is sent to the previously configured numbers. One of those numbers can reply to the message, at which point the Red Lion device then relays that response to the other numbers that received the initial alarm message.
4. The On Message property is covered in the Receiving SMS section.
Sending Email and/or SMS
1. To send an Email and/or SMS based on an alarm, refer to Figure 15 and perform the following:
a. Navigate to the Data Tags section.
b. Select a tag which is configured with an alarm; Tag1 in this example.
c. Click on the appropriate Alarm tab.
d. Use the drop-down box next to the Mail To: parameter to select the recipient of the alarm.
2. Send using the desired function. Refer to the Reference Manual (Help-Reference from the Menu bar) for guidance on how to use the SendMail, SendFile, and SendFileEx functions; the first contact in the list is Contact 0 when using these functions.
1. Referring to Figure 16, Navigate to the Programs section.
2. Create a new program.
3. Rename the program RxSMS.
4. Click the Edit button next to the Prototype: parameter at the top of the Source tab; the Edit the Program Prototype popup appears.
5. In the Parameters section, under the Type heading, select the Type associated with 1: to String.
6. Click OK.
7. Referring to Figure 17, navigate to the Communications section.
8. Go to the Navigation Pane and click on Mail Manager; the Communications Services - Mail Manager popup appears.
9. Click on the SMS tab.
10. Type the following in the On Message: field RxSMS(Data). Now, when an SMS is received, a data string is generated that contains the number from which the SMS originated and the message, separated by a colon ( : ). For example, a message of Hello World from 717-767-6511 would be represented by the following string: “17177676511:Hello World”
11. Referring to Figure 18, go to the Navigation Pane and navigate to the Data Tags section.
12. Create a new String tag.
13. Rename the new string tag Test.
14. Navigate to the Programs section.
15. Click on the RxSMS program.
16. Copy the code from Code Block 1 and paste it into the Program Code window in Crimson.
// declare local variables
// find the colon that separates the phone number from the message
colon = Find(Param1, ':', 0);
// grab just the message and discard the number it came from
message = Right(Param1, Len(Param1)-colon-1);
// populate the Test tag with the message that was received
Test = message;
Code Block 1.
17. Translate the program using the Ctrl+t shortcut.
It is the customer's responsibility to review the advice provided herein and its applicability to the system. Red Lion makes no representation about specific knowledge of the customer's system or the specific performance of the system. Red Lion is not responsible for any damage to equipment or connected systems. The use of this document is at your own risk. Red Lion standard product warranty applies.
Red Lion Technical Support
If you have any questions or trouble contact Red Lion Technical Support by clicking here or calling 1-877-432-9908.
For more information: http://www.redlion.net/support/policies-statements/warranty-statement