“You might ask how it is they’re even related. For one thing, RDBs can be [like] an extension of PLC memory,” says Hechtman. Live values can be mirrored in RDBs bi-directionally. Historical values and events can be recorded there as well. But operators and managers can interact with them too. “Over the last 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,” adds Hechtman.
SQL has four basic commands and about a hundred different modifiers that can be applied to each in various ways to achieve all types of results. Hechtman provides 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 associate these with other things: 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, their certification levels, what chemicals where added and when, who the chemical suppliers were, how long the chemicals sat before use and so forth. All of this becomes relational data, meaning that if it’s arranged properly in tables, users can run SQL queries to obtain all types of interesting results. The queries might provide insight into the most likely conditions that could result in an improper discharge so it can be prevented in the future.