Using Linux with Programmable Logic Controllers
When solving control system problems for the “real world”, a toolkit approach to problem-solving often leads to quicker and more robust solutions. This is one of the reasons we are using Linux on commercial Intel-based machines at the DuPont-Northwestern-Dow Collaborative Access Team (DND-CAT) at the Advanced Photon Source (APS). The APS (see http://www.aps.anl.gov/) is one of three third generation synchrotron X-ray sources that will provide the world's most brilliant source of X-rays for scientific research. The DND-CAT (see http://tomato.dnd.aps.anl.gov/DND/) is a collaboration formed by the DuPont Company, Northwestern University, and the Dow Chemical Company to build and operate scientific equipment at the APS to study industrial and academically interesting problems in chemistry, biology, materials science and physics. Linux (like all Unix systems) is designed around the toolkit paradigm. The tools which run under Linux provide an excellent framework for building user interfaces (e.g., Netscape, Java, Tcl/Tk, expect, World Wide Web daemons), running calculations (e.g., C, C++, FORTRAN, Perl, pvm) and interacting with external devices (GREAT access to serial devices, cards in the backplane, and of course, TCP/IP).
However, while there are efforts to equip Linux with real-time capabilities, it is not a “real-time” operating system. In addition, using commercial personal computers for control applications is a mixed blessing at best. While the systems are powerful, readily available and inexpensive, they also come with a limited number of slots on the backplane and the machine usually must be physically close to the process being controlled or monitored. This can be problematic in situations where the process takes place in a harsh environment that might cause the hardware to fail (e.g., high radiation areas, high vibration, etc.). These are important factors in the design of an entire control system. However, they are only problems if we expect Linux to provide the entire solution to the control problem rather than one tool in a toolkit approach.
At the DND-CAT, we have been designing systems that use programmable logic controllers in conjunction with Linux PCs to provide low cost automation and control systems for scientific experimental equipment.
Programmable logic controllers (PLCs) are the unsung heros of the modern industrial revolution. Long before IBM and Apple were churning out computers for the masses, factories were being automated with computerized controllers designed to interface with the “real world” (i.e., relays, motors, temperatures, DC and AC signals, etc.). These controllers are manufactured by many companies like Modicon, Allen-Bradley, Square D and others. In his booklet, History of the PLC, Dick Morley, the original inventor of the PLC, notes that the first PLC was developed at a consulting company, Bedford Associates, back in 1968. At this time, Bedford Associates was designing computer-controlled machine tools as well as peripherals for the computer industry. The PLC was originally designed to eliminate a problem in control. Before the digital computer, logic functions were implemented in relay racks where a single relay would correspond to a bit. However, relays tend to be unreliable in the long term and the “software” was hard programmed via wiring.
System reliability could be improved by replacing the relays with solid state devices. This had the advantage that the system was maintainable by electricians, technicians and control engineers. However, the “software” was still in the hard wiring of the system and difficult to change. The alternative at this time was using one of the minicomputers being developed, like the PDP-8 from Digital Equipment. While more complex control functions could be implemented, this also increased the system complexity and made it difficult to maintain for people on the factory floor.
Morley designed the first PLC to replace relay racks with a specialized real-time controller that would survive industrial environments. This meant that it had to survive tests, such as being dropped, zapped with a tesla coil and banged with a rubber mallet. Designed for continuous operation, it had no on/off switch. The real-time capabilities were—and for the most part still are—programmed into the unit using ladder logic.
Ladder logic is a rule-based language; an example is given in Figure 1. The line on the left side of the diagram shows a “power rail” with the “ground” for this rail on the right hand side (not shown). The rules for the language are coded by completing “circuits” in ladder rungs from left to right. In the diagrams, “||” corresponds to switch contacts, and “()” corresponds to relay coils. Slanted bars through the contacts and coils denote the complement. The “X” switch contacts are mapped to real binary input points, the “Y” relay coil contacts are mapped to output points, and the “C” contacts/coils are software points used for intermediate operations. In the example, closing X0 and C0 or opening X0 and C0 will energize the C10 coil thereby closing the C10 contact. The C10 contact activates Y0 and turns off Y1.
While this graphical style of programming may be strange for someone accustomed to programming in C or FORTRAN, ladder logic makes it easy for non-programmers to write useful applications. Most PLCs have a large set of functions, including timers, counters, math operations, bit shifters, etc. They have a wide variety of input and output devices, including binary and analog inputs and outputs, motor and temperature controllers, relay outputs, magnetic tachometer pickups, etc. The number of input and output points depends on the type and size of the PLC, but can range from less than 10 for a micro-PLC to over a thousand for one of the higher-end PLCs. The PLC market has grown over the years and has been affected by the computer revolution. Today, there are a number of high quality, inexpensive PLCs on the market. PLCs from the same vendor can often be networked together. In some cases, a lower-end PLC can be built for less than $500.00.
Realizing the promise of Apache® Hadoop® requires the effective deployment of compute, memory, storage and networking to achieve optimal results. With its flexibility and multitude of options, it is easy to over or under provision the server infrastructure, resulting in poor performance and high TCO. Join us for an in depth, technical discussion with industry experts from leading Hadoop and server companies who will provide insights into the key considerations for designing and deploying an optimal Hadoop cluster.
Sponsored by AMD
If you already use virtualized infrastructure, you are well on your way to leveraging the power of the cloud. Virtualization offers the promise of limitless resources, but how do you manage that scalability when your DevOps team doesn’t scale? In today’s hypercompetitive markets, fast results can make a difference between leading the pack vs. obsolescence. Organizations need more benefits from cloud computing than just raw resources. They need agility, flexibility, convenience, ROI, and control.
Stackato private Platform-as-a-Service technology from ActiveState extends your private cloud infrastructure by creating a private PaaS to provide on-demand availability, flexibility, control, and ultimately, faster time-to-market for your enterprise.
Sponsored by ActiveState
| Non-Linux FOSS: libnotify, OS X Style | Jun 18, 2013 |
| Containers—Not Virtual Machines—Are the Future Cloud | Jun 17, 2013 |
| Lock-Free Multi-Producer Multi-Consumer Queue on Ring Buffer | Jun 12, 2013 |
| Weechat, Irssi's Little Brother | Jun 11, 2013 |
| One Tail Just Isn't Enough | Jun 07, 2013 |
| Introduction to MapReduce with Hadoop on Linux | Jun 05, 2013 |
- Containers—Not Virtual Machines—Are the Future Cloud
- Non-Linux FOSS: libnotify, OS X Style
- Linux Systems Administrator
- Lock-Free Multi-Producer Multi-Consumer Queue on Ring Buffer
- Validate an E-Mail Address with PHP, the Right Way
- RSS Feeds
- Introduction to MapReduce with Hadoop on Linux
- Weechat, Irssi's Little Brother
- Senior Perl Developer
- Technical Support Rep
- Reply to comment | Linux Journal
3 hours 5 min ago - Reply to comment | Linux Journal
3 hours 51 min ago - Didn't read
4 hours 1 min ago - Reply to comment | Linux Journal
4 hours 6 min ago - Poul-Henning Kamp: welcome to
6 hours 16 min ago - This has already been done
6 hours 17 min ago - Reply to comment | Linux Journal
7 hours 2 min ago - Welcome to 1998
7 hours 51 min ago - notifier shortcomings
8 hours 15 min ago - heroku?
9 hours 51 min ago
Featured Jobs
| Linux Systems Administrator | Houston and Austin, Texas | Host Gator |
| Senior Perl Developer | Austin, Texas | Host Gator |
| Technical Support Rep | Houston and Austin, Texas | Host Gator |
| UX Designer | Austin, Texas | Host Gator |
| Web & UI Developer (JavaScript & j Query) | Austin, Texas | Host Gator |
Free Webinar: Hadoop
How to Build an Optimal Hadoop Cluster to Store and Maintain Unlimited Amounts of Data Using Microservers
Realizing the promise of Apache® Hadoop® requires the effective deployment of compute, memory, storage and networking to achieve optimal results. With its flexibility and multitude of options, it is easy to over or under provision the server infrastructure, resulting in poor performance and high TCO. Join us for an in depth, technical discussion with industry experts from leading Hadoop and server companies who will provide insights into the key considerations for designing and deploying an optimal Hadoop cluster.
Some of key questions to be discussed are:
- What is the “typical” Hadoop cluster and what should be installed on the different machine types?
- Why should you consider the typical workload patterns when making your hardware decisions?
- Are all microservers created equal for Hadoop deployments?
- How do I plan for expansion if I require more compute, memory, storage or networking?




Comments
Re: Using Linux with Programmable Logic Controllers
There is now a Linux based PLC from Sixnet. Use C++, Perl and etc. to write your control program with I/O Read/Write functions and then monitor system status with any browser. Check out www.sixnetio.com