Ladder Logic 209: Faults and Messages

This post is another in my series on Ladder Logic. As with the other posts in this series, I am using generic logic and addressing so that it can apply to various PLCs.

In previous posts in this series I have explained how numbers can be used in a fault register to determine which fault is present. Ladder Logic 203: Faults shows how a specific fault moves a number into the register, then a reset pushbutton is used to move a zero after the fault is cleared. This logic uses the same technique, however the fault message register is cleared automatically when the fault has been eliminated.

There are several ways to display fault messages on an HMI, I will cover one of the most common first. Most HMI software allows you to make a list of faults and then call them by number to display in a banner or other type of text display.

Another option is to configure the trigger to display the message by bit number as shown above. This also allows multiple messages to be displayed on a timed cycle, unlike if the message were to be displayed by value or placing a number into the message register.

The background color of the message can also be configured so that fault messages and warnings or other informational text can be displayed in the same banner. This is especially helpful if the HMI is small and doesn’t have room for more than one message display.

Besides faults and messages, these displays can be used as multi-state indicators to show the mode of a machine or station status. Other properties of the message display can also be configured such as its visibility.

As with my article on Auto Sequences, there are advantages and disadvantages to using bits versus values. Using bits allows several “states” or messages to exist at the same time, whereas a value allows only one message to be called. If your HMI does not have the ability to cycle through messages with several bit triggers active at the same time, it will be necessary to write code in the PLC that cycles through the messages.

Another method that is sometime used for message displays is to simply place a String Display on the screen. While this is simple on the HMI end, it requires the PLC program to cycle through the strings and place them into the message register, which of course must be of the STRING data type. This technique again has advantages and disadvantages.

On the plus side, string messages can be changed dynamically by the PLC programmer. As a matter of fact, the programmer can give access to the user of the touchscreen by placing links to the locations of the string registers on a screen! This allows the messages to be configured without using the HMI software.

On the minus side, it is difficult to manage background or text colors using strings. The background would have to have a color register assigned to it which would be managed separately.

In my next post I will explain some of the more advanced techniques that can be used to cycle through messages. Stay tuned!

Posted in HMIs, PLCs, Software & Programming Tagged with: , , , , ,

Application: Sensor Choices 103

Courtesy of Misumi via Omron

Today’s post concerns how sensor choices are made in real applications. I have written various posts on sensors in the past, and even participated in a Control Engineering webcast and forum last year on the topic. While I have covered a variety of technical aspects of sensing, I thought I’d explain a bit about how I chose some of the sensors in my own application.

Last Summer I showed some of the fibers I had selected for my tabletop factory, explaining that some sensors were a bit more complex than needed for certain applications. The fiber optics I had installed are now used on a more delicate application as shown in the following pictures:

Escapement Ball Detection

These fibers are positioned to detect small balls as they are ejected through the hole into these plastic boxes.

There are three of these escapements along the indexing conveyor. Each escapement drops a number of different colored balls into each box and the boxes are then examined later with a machine vision system to ensure that the correct balls are in each box.

In this case the balls don’t block the fiber optics for very long and it was important to ensure that the fiber amplifier could switch quickly, so I selected these Banner amplifiers that are used for high speed, small object detection.

Banner Fiber Amplifiers

The threshold can be set remotely using a “teach” signal, but there are also controls on the amp itself to accomplish this.


Another special purpose sensor I chose were the ones that are used to detect the plastic boxes themselves.

In this case I was constrained by both space and the fact that other objects were in the way. I want to detect the box, but not the rail on the other side of the conveyor. The sensing range of these sensors is less than two inches.

Diffuse photoeye with box

Diffuse photoeye with no box present

Notice the large cutaway. The sensor would actually detect the rail even though it wasn’t directly in front of the sensor. It’s a bit of a hack job when viewed close up like this, but I can clean it up later.

These diffuse sensors from Automation direct are pretty cool. They are very small, fairly inexpensive, and easy to mount. I have four more of these I need to mount and this application will be complete! Unfortunately two of them are on the back side of the machine and are hard to access.

Close-up of diffuse sensor shooting over rail of conveyor

Another place where there are sensors on this application is on the air cylinders. In this case though there is very little to choose from, since the sensor has to fit in the slot of the cylinder. The only real choices were NPN vs. PNP, or quick disconnect vs. pigtail wiring. These sensors are actually hall effects rather than proxes; they detect the magnetic piston inside the cylinder. Since they have to fit in the slot, the only choices are from SMC.

This is a little insight into some of the decisions that are made in machine design. Often a mechanical designer will draw all of the sensors and brackets into the design before the sensors are purchased, but in my case I just “wing it”. This machine’s entire purpose is to use as a training tool, so a but of imperfection is o.k. After all, troubleshooting and changes will be a big part of what I will be teaching.

Most of this machine is operational now via the touchscreen, at least as far as manual functions. There are indicators for all of the sensors which makes it easy to debug the operation of the system. This is going to be a lot of fun for programmers!

Posted in Applications, Machine Assembly and Fabrication, Photoeyes, Sensing, Sensors Tagged with: , , ,

Happy New Year! What Can I Teach You?

Hey, I know the holiday season is gone, but Happy New Year anyway! After all, the year is still pretty new and I’m sure everybody is excited and optimistic.

Usually around this time of year I post my plans and ideas and this year is no different.

A lot of things have changed since this time last year. At that time I had just moved into my new facility in Lebanon, Tennessee, near Nashville.

Automation Consulting Offices, January 2017

Things look very different now, as you can tell from pictures in the following posts from last year:

April 2017: First Class in New Facility
May 2017: Innovate/Fabricate
June 2017: Open House
December 2017: My Little Factory

A lot of other things have changed also. I still travel and teach classes for Automation Training, we have had three classes here in my new facility also. One of my goals was to do less traveling though, which has led to me forming a relationship with a local engineering firm, Automation NTH.

We have been creating courses for NTH customers using actual moving hardware, and I have learning a lot about how to structure courses using the more elaborate system here in my training facility. One technique that has been very successful is to provide a fully operational program and system, then remove or alter parts of it and allow students to write their own code and troubleshoot the machinery.

My own “little factory” is now partially operational, and I am ready to start teaching techniques such as Auto Sequences, Part Tracking and Recipes, and various system functions. I have posted a lot of free “how to” material in the PLC tab of this blog, but there is nothing like coming here and actually doing it yourself.

Which brings up the main point of my post today: what do you want to learn?

I am finally to the point where I can offer courses on nearly any automation topic you can think of (with the exception of robotics, no hardware for that yet). I have held courses for as few as one person at a time, and my rates are right on par with all of the other training you get from other providers. The biggest difference is, I can customize the material to exactly what you need. I have quite a bit of hardware and training equipment, as well as lots of course materials including two published books. I can cover any PLC related material (Siemens, Allen-Bradley and Automation Direct), machine design and fabrication, CAD, troubleshooting, sensors, and even board level stuff including Raspberry Pi and Arduino.

Now is the time where the rubber hits the road for me, and its time to fill some classes. So what do you say? Hit me up for some training, you’ll be glad you did!

Posted in My Little Factory, Training Tagged with: , , , ,

Starbucks Roastery

Starbucks Roastery, Seattle

A few weeks ago I made a trip to Seattle to visit my daughter Yuki and her family. She used to work at Starbucks’ corporate headquarters, and among other projects was involved in the design and startup of the Roastery, an immersive experience in coffee, from the unroasted bean to your cup.

Of course being involved in automation, I was interested in checking out the production side of things. I have done work for coffee roasters before, and much of the automation involves the usual disciplines: temperature control, material handling, packaging, and conversion (in this case, grinding of the beans). A big difference with the Roastery is that the environment is meant for an audience and the typical factory atmosphere has been enhanced with a lot of visual and auditory packaging.

An example is this beautiful brass covering over some of the mechanisms and material handling parts of the system. From a distance the immediate impression is that it is some king of giant tank, perhaps a huge vat of coffee :-). In actuality it is just a good central eyepiece that probably just covers up some of the less visually appealing piping, motors and valves in the central part of the space.

As you can see here, many of the control, structural and material handling elements of the system have been designed to be visually appealing. Because the area is built for an audience, the conveyors have been placed in clear tubes and the SCADA control is placed in an area where visitors can see what’s going on rather than in a control room or at the control enclosure. Great pains have been taken to ensure that the operations are not loud or annoying also.

It is unlikely that in a typical factory moving machinery like this would be exposed where debris could fall into the product or someone could put their hands into the mechanism, but it does make for an excellent display. The production area is not physically accessible to the public and I’m sure this is not part of the actual supply chain.

The packaging area shown above illustrates just how clean and visually appealing a factory environment can be made to appear. If production was the main purpose of the facility there would be coffee dust all over the surfaces and people would be moving around frantically and making a lot of ruckus.

Instead there is the atmosphere of a coffee shop with people sitting around the tasting bar and shopping for coffee-related paraphernalia.

When I visited Central America in early 2012 I had the privilege of touring a coffee plantation in Boquete, Panama. I was able to taste raw coffee beans and some of the world’s best brewed coffees presented by experts in the field. I realized back then that some coffees are quite expensive and vary a lot in taste, based on how/where they are grown and roasted. While the standard Starbucks coffee is not particularly to my liking, I did see a wide variety of coffees for sale at the Roastery. I’d advise anyone who is in the area to go check it out, it is near downtown Seattle at 1124 Pike Street.

By the way, the red ones are ripe and ready to be processed.

When you take the skin off, the bean looks like this and tastes quite sweet. If you ever get a chance I highly recommend a tour of a plantation. They are usually in pretty cool parts of the world!

Posted in Manufacturing, Material Handling, Sales and Marketing Tagged with: , , ,

Automation Update December 2017

It’s been a while since I’ve posted. While things are going pretty well for me right now, I’ve had a really rough past few months. I think the longest I’ve gone before without posting was a couple of weeks maybe, this time it’s been more than two months.

I’ve done a little more work on my “Factory”; as you can see in the above picture I’ve got the escapements mounted. They still need some fine tuning, but as you can see they are ready to drop little balls into the boxes on the index conveyor.

I’ve also done some work on the process side. There is a lot of signal conditioning required in order to get the tank levels and flow signal done, I haven’t tested the load cells or flow transmitter yet, but I hope to get more done over the next few weeks. I just returned from Boston and Raleigh doing some ControlLogix and Siemens S7 classes for Automation Training, I also did some SLC and Micro classes here at my place for Automation NTH. They did a nice writeup on some of the things we’ve been working on here. I didn’t have any training equipment for the RSLogix 500 platform, so I made the trainers below. They are Micro 1100s and worked well for the basics.

I hope to get a fresh start on my programs and projects with the new year. Sometimes it takes a bit of a break to get motivated. On the plus side of my problems, I did manage to lose 15 pounds!

Posted in Me, My Little Factory, Training Tagged with: , , ,

Loving Your Automation

This week’s post is not really on automation, or anything technical.

A couple of days ago I visited a local plant at the invitation of a consultant who is working with their management team to improve their processes. While this consultant is adept at efficiency, workflow and other Lean topics, he is not an expert at automation, so he came to me for some advice.

We discussed several possible simple projects to move material around, quite simple stuff really, but probably projects that this company couldn’t do in-house or even with the machine shop down the street. Anyway, when we were done they mentioned a couple of little sensor and control issues they had, and I said I’d like to take a look.

The first thing I noticed was that the sensors were quite old, as was much of the hardware on the control panel. When I opened the control panel I saw an image similar to that at the top of this post. There were wire nuts and loose wires everywhere, making the panel look like an afterthought. Upon discussing the history of some of this equipment I learned that a local integrator/controls type guy had been helping them for a long time, and he had put this equipment in years before. He was mostly retired now, and they were waiting for him to come in and advise them on how they could fix or replace the sensor. He didn’t seem to have much interest in coming in and helping them.

This brought back a lot of old memories from my past life as a controls integrator in East Tennessee. There are lots of older factories with equipment like this, and varying degrees of maintenance capability. There are also a lot of panels and wiring jobs just like this.

When I went outside to leave, I mentioned the state of the equipment to the consultant. I said that if they had a young maintenance guy that was new and just learning the plant, this would be a great opportunity to show some love to the equipment; rewire and document everything, label and organize the wiring. The response I got made me as sad as the face in the image above. He said “they won’t do that, they don’t see it as adding value”.

Unfortunately, I see this as a cultural problem. There doesn’t seem to be much pride taken in work any more in a lot of places. Nobody is even looking at the equipment unless it breaks down. Companies are out to squeeze every last dollar out of their processes, but aren’t taking care of their equipment or their people. There seems to be no motivation to love their jobs or their hardware as they would something that belonged to them.

I believe this attitude bleeds over into employee’s lives when they aren’t at work also. There are people who would do anything to have a job that gives them the opportunity to learn, practice and make money at the same time, but it seems that most people can’t wait to get out of work and kick back.

I love my job and the field I have chosen. I have passed through a lot of different phases of my career, from apprenticing to maintenance, to being a technician, then an engineer, to running a company with employees that depended on my decisions, and now finally to teaching others. I realize not everybody has the same opportunities and interest in what they are doing, but to me it is so important to take pride and responsibility for your job.

So show some love to your automation. It’s sad and waiting for some attention.

Posted in Business, Philosophies, Thoughts Tagged with: , ,

My New Trainers!

Well, its official. I have my first actual PLC trainers, in addition to the ones on the wall in My Little Factory. I think they’re awesome! They did take 8 weeks to build, but as more are made I think some the logistics things will get worked out. In addition to fabrication time, there is also the time it takes to check out the I/O and get the firmware set up.

Now they aren’t cheap, and I won’t be shipping them to any customer sites, but they do have some excellent features that you won’t find in a typical suitcase-style trainer.

First, notice that there are input, output and power banana-plug jacks on the sides. This allows hardware to be connected for training as I described in last week’s post.

On the other side there are two Ethernet ports, one for programming and one for remote I/O. There is an M12 connector to provide power to dedicated devices, as well as the power switch and power socket. One of the pushbuttons is also wired normally closed, which is helpful when explaining certain programming concepts.

Automation NTH built them and has made two more of their own that we can use with the four laptops I have loaded with software. These will be very handy with the advanced custom classes I am teaching. They and several other trainers will soon be appearing for sale on my business website.

I am also working on some much less expensive trainers for the MicroLogix 1100, shown below.

I’m evaluating this Micro 1100…

These will be in a plastic box and have more limited I/O, though it will have two analog inputs. The reason I chose this platform is that the software is free, yet in most ways it matches the SLC500 platform well enough for training. This will be my attempt at the least expensive A-B demo I can come up with.

For those who have been wondering about the status of My Little Factory, it’s still coming along, though slowly.

The pick and places are mounted, but there are several small widgets that need to be installed before I can run them, not to mention that they aren’t plumbed and the valve banks aren’t mounted yet. Its hard to break off enough time to get everything done. The ball escapements are also still languishing.

In my defense, I have been making a lot of PLC training videos for a customer and am getting better at it. This means that the online PLC classes are much closer along with my next PLC book, which includes lots of advanced stuff.

Anyway, I’m excited to get to use these new demos. Come take a class and check them out!

Posted in My Little Factory, PLCs, Trainers, Training Tagged with: , , , ,

Advanced PLC Training using Industrial Equipment

I just got back from teaching a class in California using the conveyor and training demo mentioned in my previous post on Automation NTH. I have discussed training quite a bit on this blog before, but I feel like this concept deserves special attention.

The class lasted a week and I had three students, all experienced engineers with little or no previous PLC experience. As those of you who follow this blog know, I regularly teach PLC and HMI classes for Automation Training. There are beginning and advanced classes in Allen-Bradley, Siemens PLCs and HMIs, as well as WonderWare, Industrial Communications, and other classes. When marketing classes to a broad variety of students from different backgrounds, it is necessary to standardize the training so that it applies to the widest range of companies and students.

For this class I had to create custom material specific to the customer. I have taught two similar classes using these demos previously for NTH, so some of the material has already been developed, but this is the first time we have tried it at a customer’s location. Since the goal was to create a self-guided course using this equipment it warranted the trip.

So what is the biggest difference between this and a standard PLC training class using pushbuttons and pilot lights? One of the biggest takeaways was just how complex the training could be with real hardware.. For instance, one of the first exercises I assigned was putting the system into Auto and Manual Modes along with the conditions described in my previous post on the System Routine. This is an ideal exercise for bit logic and I/O access since as you can see in the picture there is an HMI with Auto and Manual buttons as well as a selector switch, E-Stop, Power button and indicators reflecting a stack light. This provides a lot of material for discussion of system control and operation. It also segues well into the use of timers for blinking lights and pulsing a buzzer.

After doing several exercises familiarizing students with editing and basic instructions, the class got advanced pretty quickly. I had students create a system UDT and use it for control of their own program, then introduced them to a pre-written program with multiple subroutines, Add-On Instructions(AOIs), an auto sequence and all of the different program sections I have described in the PLC tab and series on this blog. After operating the conveyor demo and seeing how the system operated, I had them go through a series of operations repairing a copy of the program where I had removed rungs from each routine. After that I had them write their own auto sequence to simulate interfacing with an inspection system. We then did one full day on using the HMI software, Allen-Bradley’s FactoryTalk View ME.

Overall the class went well, but we covered a LOT of material in a very short period of time. While this may work for companies who are keeping the equipment for a while, it wouldn’t be very practical for a regional class like I do for Automation Training. The shipping and handling of the equipment alone wouldn’t warrant it. At the same time it was pretty awesome to be able to cover advanced topics like program structure, templates and sequences/state machines.

If you are interested in advanced training like this from NTH or standard PLC training through Automation Training, I would encourage you to contact either of them or hit me up if you have any questions. Of course I also teach my own custom classes in Lebanon, Tennessee, near Nashville.

Posted in Training Tagged with: , , , , ,

Live Sensors Webcast for Control Engineering

Hey, this Frank Lamb from Automation Primer. I will be doing a webcast for Control Engineering magazine on Tuesday, August 22, 2017 at 2 p.m. EST (1 p.m. CST, 11 a.m. PST, I can’t tell you MST because it’s a secret). If you are in Europe or Asia you should probably be sleeping or drinking, but come check it out anyway if you can figure out the time!

To register click HERE

I will be presenting the first part on sensing for machine applications and Chris Thompson from Matrix Technologies will be doing the second half on process control sensing. For attending and answering the highly technical and devious questions we pose at the end you will receive 1 Certified Professional Development Hour (PDH). This can be traded on eBay or The Price Is Right for cool prizes I think… but don’t take my word for it. Anyway, come check it out and come stump the presenters with your sensor application questions!

Hosted by Mark Hoske and sponsored by Balluff and Carlo Gavazzi

Posted in Me, Sensing, Vendors and Manufacturers Tagged with: , , , , ,

Ladder Logic 208: System Routine 2

Today’s post is a continuation of the series on PLC Ladder Logic I started several years ago; for more of these post click on the PLC tab at the top of the site.

In particular this continues my discussion of the System Routine. In Ladder Logic 205 I showed a method of starting an Auto Cycle state or mode, but left much to the imagination as far as how the system or machine might actually get to that state (notice the reference to the Auto Start Sequence). Today I am going to go into a bit more depth on machine starting and safety.

This post also shows a method of generating a pulse train with two timers.

Often it is important not to start machinery instantly, but rather to warn personnel around the machine that it is about to move. This is required for most machinery, with the exception of simpler machine such as test stations. The logic above shows a method of pulsing a horn to warn people that the system is starting. It requires the person starting the machine to hold the button to create the Cycle Start Request signal; the next logic shows how to use the signal to actually start the system.

This is by no means the only way to do this, but it gets across the general idea. A few things to note:
1. The operator must hold down the cycle start button for the entire time for the system to start, if he lets go the timer starts again.
2. The system won’t start unless in Auto Mode with no faults.
3. The system will not stop if in the middle of an auto sequence; this should be modified to taste. It should allow sequences to come to rest in a natural position; a specific sequence step or position can replace the sequence active bit.
4. A fault stops the Auto Cycle immediately. Again, this may not apply in every case.

The Auto Cycle bit or status is not really a mode in itself, it is more of a state within Auto Mode. Generally it is used to allow auto sequences to start or proceed, but not to disable output energization.

The techniques I have listed in these numbered series of Ladder Logic articles are things I teach in my PLC training classes. While most courses do a good job of explaining the instructions themselves, they don’t cover programming technique. If you are interested in learning more, come take a class!

Posted in PLCs, Software & Programming Tagged with: , , , ,