magazine-button
Home>Programmable Control>Columns>Databases — the perfect complement to PLCs

Databases — the perfect complement to PLCs

Written by  Steve Hechtman January 07, 2010
jan09_hechtman.jpgOkay, you’ve tackled PLCs, and now you can program them with one hand behind your back. So what’s next? What’s the next logical challenge?

Think SQL and relational databases. Why? You’d be amazed the similarity; it’s the next logical progression.

You might ask how it is they’re even related. For one thing, relational databases can sort of be an extension of PLC memory. There, live values can be mirrored bi-directionally. Historical values and events can be recorded there as well. But operators and managers can interact with them, too. I’ve spent more than 20 years of working, living, breathing and thinking PLCs, but during the past six years, I’ve delved heavily into SQL and learned a lot about relational databases. I’ve discovered that working with SQL is remarkably similar to working with PLCs and ladder logic.

SQL has four basic commands and about a hundred different modifiers that can be applied to each, which can be applied in various ways to achieve all types of results.  Here’s an example: Imagine effluent from a wastewater plant with its flow, PH and other things being monitored and logged. That’s what you typically see. But now let’s associate other things with these, such as discrete lab results, the name of the persons who did the lab work, the lab equipment IDs and calibration expiration dates, who was on shift at the time and the shift just prior, what their certification levels were, what chemicals where added and when, who the chemical suppliers were, how long the chemicals sat before use, and so forth ad infinitum. All of this becomes relational data, meaning that if it’s arranged properly in tables, you can run SQL queries to obtain all types of interesting results. You might get insight into the most likely conditions that could result in an improper discharge so it could be prevented in the future.

In my explorations of SQL, I found myself looking at the layout of my tables and evaluating the pros and cons of each layout. I massaged them, turned them on their side, upside-down, and finally ended up with the most appropriate arrangement for my application. And similar to PLC programming, I explored innumerable what-if scenarios. I was struck by the amazing similarity in my approach to developing solutions for PLCs. This has been a lot of fun — in fact, exhilarating — just like PLCs used to be. It’s the next logical progression, you know.

SQL is a high-level language that isn’t very hard to learn, and you can be very clever with it. I prefer to think of it as a natural extension to my PLC programming skills. Now that you have the machinery running, what did it do? Furthermore, relational databases and SQL pull people and processes together. Machines don’t run alone; they’re merely part of a containing process and that process was devised by people. SQL and relational databases form the bridge to integrate processes, machinery and people together. I don’t believe a COTS (commercial-off-the-shelf) package can do it any more than you could offer a COTS palletizer program and have it be of any use. It just doesn’t work that way. Every machine is different, and every business process is different.

That’s where the SQL comes in: it has to duplicate or augment existing process flows and these are intimately connected to the machinery. And that’s why the PLC programmer is best suited to implement solutions involving PLCs and relational databases.

So where do you start? I would suggest picking up a book at the bookstore, like one of those Dummies books, then download and install the open-source MySQL database server along with the MySQL Administrator and Query Browser. It only takes a few minutes to install and then start playing. At the end of an evening, you’ll probably be very excited with all of your newfound knowledge and be thinking of endless ways to employ it in your own field of practice.

Happy SQLing!


Steve Hechtman is the president of Inductive Automation.

Add comment


Security code
Refresh

The global programmable logic controller (PLC) and PLC-based programmable automation controller (PAC) market declined significantly across all regions of the world in 2009, but that is expected to change over…
Category: News
Read more...
KeControl C3, KEBA’s newest generation of controls, which has their debut on the SPS/IPC/DRIVES fair in Nuremberg in November 2009, have been selected as a winner of the iF product…
Category: News
Read more...
This year, with all of the economic challenges facing manufacturers, staying competitive is going to require cost reductions, increased productivity and efficiencies, innovation and the adoption of new technologies to…
Category: Features
Read more...
Okay, you’ve tackled PLCs, and now you can program them with one hand behind your back. So what’s next? What’s the next logical challenge? Think SQL and relational databases. Why?…
Category: Columns
Read more...
The automation systems market for discrete industries started to slow down rapidly with the economic trouble alarms that started sounding in the U.S. at the end of 2007. The manufacturing…
Category: News
Read more...
Californians have always been faced with the problem of how best to conserve, control and move water. California has a wide diversity of climactic and geographical contrasts. The northern part…
Category: Features
Read more...
What kind of controller is best for your application? Is it a PLC (programmable logic controller) — or perhaps you should use a PAC (programmable automation controller), or maybe a…
Category: Features
Read more...
Through the ’90s and the past decade, PCs became indispensable to every business, and naturally, many people and vendors started looking at using them to control machines and processes on…
Category: Features
Read more...
  • Latest Products

    • Programmable automation controller
      Programmable automation controller The new Allen-Bradley CompactLogix 5370 programmable automation controllers (PACs) from Rockwell Automation bring machine builders a high-performance, right-sized integrated motion control solution for their machine applications. The 5370 series, which…
      Read more...
    • Combo HMI-PLC with custom plug-in I/O
      Combo HMI-PLC with custom plug-in I/O Maple Systems' Human Machine Controller (HMC) combines an HMI and PLC into one unit. With customizable I/O, the HMC accepts up to five plug-in I/O modules with varying configurations of…
      Read more...
    • Programmable automation controllers
      Programmable automation controllers The Allen-Bradley ControlLogix 5570 Series programmable automation controllers (PACs) from Rockwell Automation include the ControlLogix 5571, 5572, 5572S, 5573, 5573S, 5574 and 5575 controllers. The PACs feature enhanced process, motion,…
      Read more...

    MA Online Resource Centre



    Featured Video

    More Videos...