M4 PLC Messages
From PTAGISWiki
M4 PLC Messaging
| |
Author
| Troy Humphrey
|
Overview
Currently Multimon receives unsolicited messages from the PLC. The PLC will send a message whenever there is a state change or every 5 seconds, which ever comes first. The PLC sends 3-6 words or 'elements', depending on the site, starting at N7:1 and ending at N7:3 or N7:6.
N7:1 has all the switches or 'state changes' mapped to it through the PLC.
N7:2 is the A sample rate.
N7:3 is the B sample rate.
When more than 3 elements are sent the other 3 are copies of the first 3.
N7:1 is then broken down further by bit in Multimon, where the user assigns a text string that is written to the raw file when a particular bit is set to 1 and a separate text string that is written to the raw file when the bit is set to 0. The following Excel spreadsheet has a breakdown of the state changes and corresponding text that is written to the raw file for each state change and each site along with the number of elements that are sent by the PLC when a state change occurs.
Multimon PLC Messages
Issue
It is proving difficult and perhaps costly to write drivers so that M4 can receive unsolicited messages. Allen Bradley's protocols can be reverse engineered but at a people power cost. Nadia and John are investigating the possibility of purchasing source code that will decipher Allen Bradley Ethernet IP protocol but this may prove to be costly as well.
If we can relax the unsolicited message requirement and poll for the data it may speed up development and decrease costs.
Possible Solution
If we started with N7:1 and grabbed the next 15 elements (N7:1-N7:16) that should give us plenty of room to expand. (currently we are limited to 16 different state changes to monitor). Perhaps we designate 8 words for switch state changes (something we can break down to the bit level(128 state changes could be monitored) and 8 words for sample rates, level readings, temperature readings in case we ever want to record that type of data.
M4 would then compare the current 'get' to the previous and if there is a difference, report only the difference.
I propose for testing purposes that we are given the ability to set the polling rate and possibly turn it off to see if polling has an adverse affect on the performance test or speed test. We could run our speed test with no polling and then turn on polling and compare the results.
I also propose that we are given a form in M4 that we can assign a string to the ON state and the OFF state of each bit.
| PLC Address | ON MESSAGE (Bit set to 1) | OFF MESSAGE (Bit set to 0) |
| N7:1/0 | AC POWER ON | AC POWER OFF |
| N7:1/1 | A SAMPLE BYPASS ON | A SAMPLE BYPASS OFF |
| N7:1/2 | PRIMARY BYPASS OPEN | PRIMARY BYPASS CLOSSED |
And a separate form where we can assign a string that will accommodate the sample rate or a level or temperature reading.
| PLC Address | PARAMETER DESCRIPTION(what the value of the word corresponds to) |
| N7:9 | A SAMPLE RATE |
| N7:10 | B SAMPLE RATE |
| N7:11 | NORTH LADDER TEMPERATURE |
