Ladder Logic 403: Message Scrolling and Multiple Faults
Today’s post is in answer to a question from Bruno on my last post on Faults and Messages. Bruno asks “If two faults happen at the same time, will this procedure work?”
This is a more complex question than it might appear to be, so I have created my third advanced topic in my Ladder Logic series.
First off, we need to address whether two faults can happen at the same time. Often one fault may cause another; an example might be a fault causes an “air dump”, which prevents another cylinder from reaching end of stroke. The logic at the top of this page shows that if a normally closed System Fault bit is placed in series with the fault logic for an individual fault, it prevents multiple faults from occurring. Even if somehow two faults happen during the same scan (highly unlikely, scans are typically on the order of 30-50ms max), the first fault would prevent the second from happening. So proper programming can isolate the initial cause quite easily.
Still, on larger “zoned” machines which have multiple fault registers, sections of a machine or system may operate independently of each other. Yet if you only have one HMI, all of the faults still need to be recorded and enunciated. In this case there needs to be a fault register for each cell or station. On the “Fault History” screen of a typical HMI, each register would have a separate trigger, so multiple faults would appear on the list.
But what about if you have a single information banner and want to put multiple messages on the screen? This requires code that will search your fault and information registers and then scroll them across your banner or message display. The following logic shows a method of doing this.
This code is from a template I used to use when working at Wright. There is a lot more explanation that goes with this, some of which can be found in my other ladder logic posts. This template used a spreadsheet to generate “cells” which were populated with standard code that would serve as a starting point for a program. Look at my posts on program organization and PLC templates for more info.
Each cell generates its own Faults, Info and Warnings, three separate message categories that are searched and scrolled on three different banners on each screen of the HMI. There are typically 20-40 cells on a large machine or system, so the search for messages covers 60-120 different registers, each of which may contain 10 or more messages, categorized by bits of a double integer. This allows for thousands of possible messages to be searched and displayed on just three banners.
This template is for Allen-Bradley ControlLogix, but is quite easy to reproduce on most major PLC platforms. It is even easier on a Siemens platform using STL (Statement List) or by using any of the Structured Text languages. Do-While and For-Next loops are common in these languages, a bit more difficult in ladder logic. Another method of doing this uses Allen-Bradley’s FSC (File Search and Compare) instruction.
This topic can get pretty complex, and as I mentioned involves a lot of other concepts listed in my series on PLCs. I teach automation and programming topics like this for a living and also consult with companies, so if you need help with a program or want to learn more on the topic, hit me up on my company site or Linked In.
Thank you for not spelling that “discretely”.
Re: ladder Logic: Fault Detection and Messages.
“There are a couple of methods of resetting the fault. One is to clear the register word that contains the faults, in this case word 10. This fault word may be for only this cell allowing the system reset signal to reset faults in sections if desired; word 10 for cell 1, word 11 for cell 2, etc. Another method is to reset or unlatch faults individually.”
I would prefer to use word 11 for cell 1, word 12 for cell 2, etc. I realize this wastes a word that may not get used for something else but I like keeping things aligned. I see a lot of 0=1, 1=2, etc. in our older programming (back when memory was tight. Which do you see as the most common protocol now?
Love the school. The writing is tight…like a good program.George Steel
gsteel@bellsouth.net
I see a variety of methods in industry. Allen-Bradley has instructions for both digital and analog alarms, some people like to use those. I generally build my own Add On Instruction (AOI) that I use for resetting, acknowledging and archiving faults, in Siemens I would build e reusable alarm structure into an FC or FB. For simple alarms I generally use the word method described above with a somewhat complicated timer rung.