How to send a text message or email from Allen Bradley Micro800 series PLCs

Receive alerts from your Micro800 PLC. Micro820, Micro850, and Micro870 PLCs can send text messages or emails with p1ge0n.

Pre-requisites:

  1. P1ge0nFly should be installed and running on Windows computer and allowed through the firewall (see installation instructions here)
  2. The computer running p1ge0n should have a static IP address
  3. PLC must be connected to the same network as the computer which is running p1ge0nFly (see some guidance on networking to p1ge0n here)
  4. Connected Components Workbench installed should be version 20.01.00 or later in order to use our UDFB. You should be able to update it off of Rockwell’s website.

As a refresher, sending a message to p1ge0n requires creating a socket client.  For the Micro800 series PLC, we have created a User-Defined-Function-Block (UDFB) to automatically create the socket, connect to p1ge0n, send data, and close the socket.  You as the user only define the message to be sent, identify the IP address of the Windows PC running p1ge0nFly, and identify the port number for p1ge0nFly.

p1ge0n Socket UDFB for Micro800 PLCs

In our example we defined three local variables to the program running on the PLC.  The data type for port is UINT and the data type for IP_Addr is a string (the UDFB parses it as necessary).

Data Types of port and IP_Addr

Message_2 is also a string.  This is a preset string with the information you want to send.  In our program, message_2 is modified depending on the situation.  For example, our program created one message as an alarm if the cycle count was low and a different message to tell us the final production count.

Once you have the p1ge0n_socket UDFB placed into the program, you can create triggers to call the function to send the message.  For our example, we have two different triggers depending on the event, but more can be included.

Trigger the UDFB when you want to send a message

We defined message_2 for each of these triggers using a similar method to what follows:

Define message_2 on another rung and trigger send_count once it is created

Count is collected using the standard counting protocols in connected components workbench (CCW).  If the count is at least 1, the ANY_TO_STRING command will convert this into a string, which gets added onto end of the preset message string (“leah@p1ge0n.com<>production count was ”) using the INSERT command.  This combined string then becomes message_2 to send the cycle count to p1ge0n. 

The formatting of message_2 needs to be as follows to send the text message/email:

“leah@p1ge0n.com<>production count was 70”

This will send a message when triggered to leah@p1ge0n.com which states “production count was 70”. The trigger can be the end of the day, only under specific circumstances, when the machine is turned off, or any other event which you would like to know about.

Email from p1ge0n with production count

Note 1: Because of limitations within CCW, the length of message_2 needs to be under 256 total characters.  If a longer message is needed, it must be broken up into two messages and sent one after the other.

Note 2: It is possible to send to multiple email addresses/phone numbers – just separate the different destinations by commas – for example:  “leah@p1ge0n.com,15555555555 <>this is my message” will send to both leah@p1ge0n.com and to the phone number listed.

When you connect to the PLC and download the program you created, select “Download with Project Values” when the option box pops up.  This downloads the values you created for the port number, IP address, and the string for the message to the PLC (otherwise you will have empty variables).

Select “Download with Project Values” when connecting to the PLC

As a final note, it is possible that when you run the code, you get an error in the p1ge0n UDFB. The most likely cause of this error is that you aren’t able to connect with p1ge0nFly running on the other computer, due to not making it through the firewall or entering the wrong port number or IP address. A complete list of errors is found in the Micro800 Connected Components Workbench manual, starting on page 585, and the UDFB will output the error ID numbers.

We would love to work with you to get your Micro800 PLC set up to send text messages and emails. Contact us today to get started.