Merging modern software development with electrons and metal
Random header image... Refresh for more!

Book Review: Cascading Logic

Cascading Logic: A Machine Control Methodology for Programmable Logic Controllers by Gary Kirckof, P.E., published by the ISA.
My rating: 4.0 out of 5.0
Summary: A good but imperfect book

Cascading Logic is a unique book: it is the only intermediate level PLC programming book that I found (I have not found any advanced PLC books).  Sometime I should discuss why I think there are so few intermediate and advanced books (basically, PLC market size and fragmentation), but here is what I expect for each level:

  • Beginner book: an overview of PLC programming, and some discussion on how to do tasks.
  • Intermediate book:  how to put a complete PLC program together and why you should do things a certain way (best practices).
  • Advanced book: how to write the best PLC program, tips and tricks, covers advanced applications such as motion control, interfacing to advanced sensors (such as machine vision), analog I/O, and using advanced PLC instructions.

At $89 for a 206-page book, Cascading Logic is not a good value (unless you can find it used for a decent price), but it is still very much worth reading if you program PLCs professionally.

So what do I think?

  • It’s the only PLC book I found which covers how you should program a PLC (the best practices of PLC programming).
  • It’s not for beginners (in PLC programming or automation); a beginner would have a hard time following the examples.
  • The book is well written overall, but the style is terse.
  • The book builds on concepts to show a pretty complete program that covers most areas needed for a real machine (including operation, startup, errors, maintenance) and how to write code that can  be easily understood and updated.
  • The examples are too narrowly focused on automotive assembly machines; automation is a very broad field.  My PLC usage has nothing in common with the author’s examples.
  • The book only uses basic PLC instructions that all PLC have.  Overall, this is a plus, since it makes the book applicable to all PLCs, and thus a good starting point for any PLC programmer.
  • The book only covers basic systems with pneumatics, binary sensors,  and clutched motors.

I’m very glad I bought the book.  I have a lot of thoughts on PLC and PC automation programming, but I need to finish a series or two first…

February 21, 2012   No Comments

Free PLC Simulators

I recently decided to see what kind of free PLC simulators and integrated development environments (IDE) I could find that run on Windows.  A free IDE+simulator is great for teaching; for example, I can give examples that any of my readers can try out, but if I use a real PLC, I’ll be using what I have (Panasonic), which probably isn’t what most of my readers have.

Here is what I found:

  • Tri-PLC’s i-TRiLOGI free development environment supports both ladder logic and their version of BASIC and includes a simulator.  Tri-PLC also sells low cost PLCs.
  • Infoteam’s OpenPCS free development environment supports all the IEC61131 languages (including ladder and structured text) and includes a free PC-based simulator.  Infoteam’s business model is similar to CoDeSys:  customizing and charging money for the OpenPCS runtime.  (CoDeSys also has a simulator, but their free download is time-limited to a maximum 1 hour continuous run time.)
  • EasyPLC is basically a soft-PLC with a HMI builder and is free in demo mode (simulation only).  It’s worth a look: for example, its simulation mode includes 3D.  The commercial license is affordable, starting at 50 Euros).
  • I vaguely recall rumors of being able to use an Allen-Bradley simulator for free, but couldn’t find anything when I searched (besides,  I don’t think the development software would be free….) Note 3/15/2012: see next paragraph for A-B link
  • Via MrPLC, I found a link for Allen Bradley MicroLogix 1000/1100 free starter software and RSLogic Emulate 500 simulator.  I haven’t tried this combo out, and I don’t know the limitations, but in theory you should be able to learn some A-B programming for free.

I choose to download and try out OpenPCS because I really like having support for all the IEC61131 programming languages.  I haven’t used OpenPCS enough to be able to discuss it intelligently, but hopefully I’ll be able to write more in a month or two.

If you really want to learn PLCs, then at some point I think you have to buy a real PLC and connect it to real sensors and outputs.  Simulating stuff just isn’t the same.  Real PLC’s can be quite affordable; many manufacturers (including IDEC and Siemens) sell complete kits (PLC and software, plus sometimes a HMI) for $250-$400, Tri-PLC and the Automation Direct Click! series are <$150 and have free software, Panasonic FPWinPro 6 Basic is free (but code size limited), etc.

Beyond PLC’s there are some interesting options.  For example in the PAC world Opto 22 has a free IDE and control simulator, but you need Opto 22 I/O since there’s no I/O simulation.  In the robotic world, Denso Robotics has a free 3 month trial of WinCaps III which includes 3D robot simulation with no controller required.

Back in the PLC world, I’ve finished reading Cascading Logic; it’s a good book, and I hope to get a review up fairly soon.

December 5, 2011   No Comments

Advanced PLC Programming Books

I’ve finished searching for books on advanced Programmable Logic Controller programming.  Mainstream programming languages such as C, C++, Java, and C# have a plethora of advanced books.  However, I didn’t find much on advanced ladder logic.

The book that seems the closest to what I’m looking for is Cascading Logic: A Machine Control Methodology for Programmable Logic Controllers by Gary Kirchof.  I will be able to judge for myself soon, since a reasonably price copy is on its way to me.  (And hopefully I’ll have time to write a review soon.)

The second PLC book that impressed me is Programmable Logic Controllers: An Emphasis on Design and Application by Kelvin Erickson.  It’s meant as a college textbook, but it is pretty comprehensive (>1500 pages) and does have a heavy emphasis on real world techniques.  I couldn’t find it at a reasonable price, so I won’t be reviewing it.

I am surprised by how many PLC programming books are meant as textbooks; I’d say at least half are.  Also, I don’t think any book covers advanced Structured Text, although a book might devote a chapter to it.

October 6, 2011   No Comments

PLC Programming Best Practices?

One thing I really like about the software development books I’m reading is that most of them don’t just describe features, but give practical advice, based on experience, on the best ways to do things.

I’m wondering if they are any similar books for PLC programming?  Books that don’t just discuss how to write a ladder logic program, but the best way to do it — and why that recommended way works better.  (Note: I’m thinking books here, not websites or blogs, because this is the kind of topic that is best approached in a systemic way by a substantial book, not a serious of disconnected posts.  The Art of Unit Testing is a good example of what I’d like to see.)

September 27, 2011   No Comments

Panasonic FP0-R PLC Surprises

Recently, I used my first Panasonic FP0-R PLC in a machine (as a drop in replacement for a FP0). Even though I’ve read the FP0-R specifications, I did have a couple surprises along my journey to a working machine.

The not so good surprises:

  • You need the FPWin Pro V6.0 or newer development software to initially download to the FP0-R.  Pretty frustrating, since I only had FPWinPro V5.3.
  • OK, Panasonic also offers FPWinGR, but I’ll never consider it, because FPWinPro implements the IEC-61131 programming standard (yeah, structured text! ) and when I first tried FPWinGR, about a decade ago, it was, to put it nicely, a putrid steaming pile of crap (OK, I’ve seen worse, but it wasn’t very good then).
  • Of course, getting a new, full versions of these (FPWinPro or FPWinGR) costs money.
  • The free program loader program I was using, PLC UpDown V2.55, doesn’t work with the FP0-R, and I can’t find a newer version.  FP UpDown let me upload the memory of the PLC into a NSU file and then download that NSU file into another PLC.
  • Panasonic does have a free loader program, FPLoader, that does work with the FP0-R, but it only downaloads FPWinGR programs (not FPWinPro), and can’t upload.

But I was pleasantly surprised, because:

  • Panasonic has a free FPWinPro version, FPWinPro 6.2 basic, that is only limited by the maximum program size, which varies depending on the PLC model; it’s 2.7K/300 steps for the FP0/FP0-R and 12K/500 steps for the FP Sigma.  My current programs are all smaller than that, so thank you, Panasonic!
  • The FP0-R has compatibility modes that let it mimic FP0 PLCs such as the FP0-C32 and FP0-T32.  When the FP0-R is in compatibility mode, you can use FPWinPro 5 (or FP UpDown).  I found trying to switch between native and compatibility modes a little unpredictable.
  • So you can still download a large FP0 program without upgrading to FPWinPro V6 by first using V6.2 basic to set compatibility mode, and then using the older software to download the big program.
  • The second serial port is now much faster, with a maximum speed of 115200 bps, while the FP0′s topped out at 19200 bps.
  • The USB tool port worked smoothly.

January 15, 2011   No Comments

New Micro PLCs Go In Different Directions

It’s interesting to compare and contrast new micro PLCs from Siemens (S7-1200) and Panasonic (FP0-R).  Both are compelling upgrades from the previous series (Siemens S7-200, Panasonic FP0), but while Siemens adds Ethernet connectivity, Panasonic adds a USB port.

The FP0-R series looks like a direct replacement for the FP0, but with more: more memory, faster instructions, faster counters, and faster pulse outputs.  The biggest upgrade is a USB port, which is very nice: no custom programming cable required!  Or save some money: I like to use PLCs with two comm ports, one for communicating with the PC, and one for debug.  With the added USB port, I can use a PLC with one serial port, saving about $30, and use the USB port for debug.

I hope Panasonic has improved the USB port speed; I’ve heard that the FPX series uses an internal serial/USB bridge, so the USB port is limited to a wimpy 115,200 bps.

The FP0-R still isn’t as capable as the FPG (FP Sigma) series, but since it’s the same price as the FP0, I’m already looking at changing over from the FP0 to the FP0-R.

The Siemens S7-1200 models appear similar to the previous S7-200 models, but with more: more memory, more analog (even the base models have analog inputs), faster instructions, faster counters, more expansion (using signal boards) and faster pulse outputs.

What’s wonderful?  Siemens added an Ethernet port with Profinet and standard TCP/IP capabilities.  Networked devices are so much more convenient and useful than PC-connected USB devices.  For example, Profinet should make it simple and inexpensive to create a peer to peer PLC network, in addition to high speed communications to HMIs.  You have to add expensive networking modules to create a Panasonic PLC network.

The S7-1200 CPUs include other goodies, such as room for extra boards on the base CPU (for extra comm ports or wimpy (2DI/2DO or 1AO) I/O boards), 1M flash memory for extra (non-program) storage, and a proprietary memory slot.

Unfortunately, Siemen’s STEP7 Basic software currently only includes Relay Ladder Logic and Function Block programming; Panasonic’s FPWinPro supports all five IEC61131 languages, including my favorite: Structured Text.

Like the previous S7-200 series, base models have limited expansion: no signal modules for the 1211, 2 for the 1212, and 7 for the 1214.

The Panasonic FP0-R PLCs are much smaller; the transistor output models use high density box header connectors , while Siemens provides screw terminals.  I much prefer the box headers, since I can easily make a cable to a custom PCB breakout board.  It’s hard to wire directly with screw terminals without additional terminal blocks (for extra power and ground, etc).

The Panasonic FPX series are more like the S7-1200, since they also use screw terminals and provide room for plug in modules.

Excluding communications (USB vs Ethernet), the S7-1200, FP0-R, and FP-X are all similar in capabilities and price (IIRC, S7-1214 DC/DC/DC, FP0R-C32CT, and FPX-C30TD are all about $280, while the FP0R-C32T is about $245).

Which will I use?  I’d love to try out the S7-1200, but for my current projects the FP0-R and FPG are a better fit, since they support Structured Text and use box header connectors.

The S7-1200 is pretty close to a no-brainer if you need Ethernet:  Panasonic’s Ethernet module (FPWeb2; ~$430) alone costs more than a S7-1214 CPU; Automation Direct’s Ethernet modules start at $175, and you still have to add the PLC CPU.

I plan to write about this in more detail: I think micro PLCs are a great alternative to PC I/O options such as PCI boards from Advantech or USB modules from Measurement Computing.  The PLC’s cost the same or less for 24V I/Os, and have the advantage of being programmable — it’s nice to have the PLC handle some I/O, while the PC handles the rest via serial, USB, or Ethernet communications to the PLC.

Final notes:

  • Panasonic has gone backwards by not listing prices and requiring registration to download PDFs.
  • If you’re interested in the S7-1200, talk to your local distributor to see if they have a package deal.  For example, in Silicon Valley, E&M periodically offers 1 day introductions with a nice deal on the S7-1211.

October 29, 2009   2 Comments

Making a Panasonic PLC Programming Cable

I’ve added a section on my wiki describing how to make a serial cable to connect to the Panasonic FP0 or FP Sigma Programming Port. Later I hope to update it with more pictures.

Tony

FPG Programming Cable

July 16, 2008   4 Comments

Limitations to the Personal Computer Model

I was looking at automation blogs and come across this comment about Beckhoff:

“Europe’s most successful PC pioneer, Hans Beckhoff, has a simple two-part formula for success: 1. Put everything in software, on one platform, and 2. Give the customer everything he needs so he doesn’t have to buy anything else.

Interesting, since Beckhoff makes its money selling hardware. But, its hardware is all PC connected.

A lot of people view copying the PC industry as the inevitable way forward for the automation industry. This means using PC industry standards, such as OPC (originally based on MS’s OLE technology), Windows XP and CE, Ethernet, PXI, and embedded PC’s.

The big advantage is the lower cost, and theoretically more standardization, but there are many disadvantages, such as:

  • The short lifespan of PC technology. A personal example – I have a PC at home with a good Quadro AGP video card. How many new AMD AM2 motherboards support AGP? 1, and it’s not very good. So building equipment designed to last 5 years or more with generic PC technology will have problems with spares down the road.
  • PC technology isn’t always so cheap. Sure, generic PC’s, even in a 4U rack mount case, are cheap. But if you need IP67, or fanless, or a PanelPC, or guaranteed spares – well, your performance goes down and your price goes up.
  • Innovation is shifting away from PC’s. If an automation company continues to be PC-centric, they will miss innovation based on the new innovation drivers, such as web standards (now much sexier than MS’s COM technology), cell phones, and automotive electronics.
  • Commodity OS’s aren’t real time. I know, I’ve tried to do very soft real time with Windows, and it wasn’t pretty. Linux looks like it’s slowly getting there for soft real time, but it’s not mainstream yet in the factory. Yes, there are add-ons, but they cost extra in money (e.g. Venturecom) or time (learning hard RT extensions for Linux)
  • PC standards often do not support industrial needs well, and thus need tweaking; for example, the PCI bus morphing into CompactPCI and PXI, and Ethernet being extended with EtherCAT. But the volume goes down, prices go up, and you lose some of what made PC technology compelling.
  • Too many standards – think of all the industrial Ethernet protocols.
  • Old technology does not go away, so PC automation control needs to be able to communicate with the rest of the world, including PLC’s.

A company can’t be everything to everybody, and Beckhoff is right to focus on PC-centric automation. But if I were running an automation component company, my formula would be “1. Give your customer products that help him build better machines and 2. Understand you cannot meet all of your customer’s needs – integrate easily with the rest of the world.”

Tony

June 8, 2007   No Comments