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

Reactive Reading

I’ve managed to do a bit of professional reading in the recent past, from process to PLC to mind-blowingly functional.

Business Process Books

I read one business book, Profit Beyond Measure by Johnson and Broms.  They use the Toyota Production System and Scania’s modular design process to examine how to manage by means (MBM), instead of manage by results (MBR).

In MBR, management sets financial targets such as profit margins, sales level, or market share.  In the MBM approach, management focuses on the process (how) the company achieves its result, for example, how work flows through from customer order to customer delivery (and payment!).

Three Fun, Mind Blowing MEAPs

I skimmed three MEAPs.  A MEAP means you get to download and read the book while it is being written.  Since I still like dead tree books, I paid a little bit extra so when the books are finished, I will get real books hot off the presses.  I thought all three books were good, maybe excellent.  My selections were:

  • Grokking Functional Programming (Grokking FP) by Aslam Kahn is an introductory book on functional programming.  The goal is to introduce the fundamentals of functional programming in an easy manner, without any scary mathematics, and then to get you to truly understand (“grok”) how to approach programming challenges in the functional way.  The book is filled with examples and exercises, since you don’t really understand a method until you do it yourself.
  • Functional Reactive Programming (FRP) by Blackheath and Jones.  FRP uses cells (representing values over time) and streams (actions/events over time) to handle dependencies.  Since you declare what depends on what, when something happens (such as a new event), the FRP system knows how to update everything that depends on that change in the proper order.  Think of how a spreadsheet updates itself when you change a value.  FRP is a good match for event-based systems such as GUIs, but not so good when you need actions to happen in a predictable sequence (especially hard real time systems).
  • Reactive Extensions In Action by Tamir Dresher.  Reaction Extensions (Rx) is described as “observables + LINQ + schedulers” and has many (but not all) of the features of a Functional Reactive Programming library.  Originally written in .NET by Microsoft, Rx has been ported to at least 13 languages (including JavaScript, C++, Ruby, and Python) and is used extensively outside of Microsoft.

I found FRP to be very interesting, but I don’t see an immediate need for it right now.

I do plan on going back through Grokking FP and doing all examples because although I am somewhat familiar with a lot of functional ideas, I do not yet think in functional way — I haven’t grokked it yet.

I am also planning on going through Rx In Action in depth, because I think it may be a good way to re-factor one of my programs at work that has significant event handling.  I’m interested in Rx because I like its:

  1. Support for handling events as streams (like FRP)
  2. Support for event timeouts
  3. Support for propagating errors that occur in event handlers
  4. .NET support (I like to program in C#)
  5. Better support for sequences (which I need)
  6. Concurrency control with schedulers
  7. The ReactiveUI GUI library

Functional programming is hot right now because some of its features (such as immutable types) can make parallel programming significantly easier.  I do think automation programmers should learn it (I can wholeheartedly recommend Grokking FP) because it will truly expand your mind, and FP is becoming more popular.

Programmable Logic Controller (PLC) News

On the PLC side, I have decided to skim through Programmable Logic Controllers: An Emphasis On Design And Application by Kelvin Erickson.  I started trying to read it thoroughly, but haven’t made much progress so I am changing my approach to skimming.

Based on a reader recommendation, I just bought Progammable Logic Controllers: A Practical Approach to IEC 61131-3 Using CoDeSys by Dag Hanssen.  I plan on skimming it next, and then will share my findings.

Both appear to be well written, both are a bit pricey, both were written by professors, and both are introductory books.

The contrast with mainstream programming books is fun:

  • My three Manning books (print and ebook) cost the same as PLCs by Hanssen.  I paid $70 to Manning with a 50% discount (you can get that by signing up with Manning and being patient).  I paid $70 for PLCs by Hanssen (new, with $9 Alibris discount; list price is $120), and $50 for PLCs by Erickson (first edition, used; list price for current version (Third Edition) is $85).
  • The MEAPs are well written, advanced books covering cutting edge topics.  The PLC books are good, too, but they are introductory textbooks.
  • The MEAPs were written by developers who use these tools in their day to day jobs.  The PLC books were written by professors.

So I haven’t found an advanced PLC programming book yet, however, there is good news: Frank Lamb, proprietor of the Automation Primer blog and author of Industrial Automation: Hands On, has announced that he has started writing one.

April 19, 2016   No Comments

A Behemoth Book To Reivew

PLC Book

I just received my copy of Programmable Logic Controllers: An Emphasis On Design And Application.  When I saw a used First Edition on Amazon for $50, I snapped it up.  (I looked at the differences between the First and Second Editions, and decided that the Second Edition didn’t add anything I needed).

I am planning on writing a review, but it’ll be a while since the book has 1461 pages — but that means on a per page basis, it’s much cheaper than Cascading Logic!  (And, yes, I still do recommend Cascading Logic, but it is overpriced.)

Two PLC Books

Two PLC Books

PLCs: An Emphasis… Cascading Logic
List Price $85.00 $89.00
Type Hardcover Softcover
Pages 1504 206
Weight (oz) 80 14.5
Price Per Page $0.056 $0.432
Price Per Oz $1.06 $6.14

April 29, 2014   2 Comments

Leuze and Sick Safety PLCs

I like simplicity, but sometimes complexity is unavoidable.  Recently, I had to re-design a safety system to meet SEMI S2 requirements without destroying the customer’s parts.  Unfortunately, meeting both requirements required a more complex safety system than a traditional fixed safety controller, so I had a choice: add complex wired logic to our current safety controller or move to a programmable safety PLC.

The choice was easy: go for an expandable safety PLC because:

  1. The safety PLC is much more flexible.
    1. If someone finds a problem in the safety logic, it’s easy to update: just send out the update to certified techs to update, instead of re-wiring every machine.
    2. If we need to add a new feature, again it’s an easy update instead of laborious re-wiring.
    3. If a new feature requires additional inputs or outputs, we can always add a new I/O module, and keep the wiring simple.
    4. We can handle different customer safety requirements by changing the Safety PLC software, while the base hardware stays the same.
  2. The safety PLC is much easier to build: it’s straightforward wiring to inputs and outputs, instead of criss-crossing wires trying to implement safety logic.  My feeling is that the safety PLC probably saves money, too, because although the initial cost may be higher, we will have far less wiring problems (and they’ll be easier to troubleshoot) and troubleshooting problems always takes a lot of time.

On the other hand, the price of most safety PLCs is really scary: I don’t need a super-fancy, networked über-safety PLC.  So I checked out my list of usual suspects plus did a lot of searching, and came up with two candidates I really liked: the Leuze MSI-202 and the Sick Flexi Soft.  (Actually, maybe I found 4, since the Phoenix PSR-TRISAFE looks just like the Leuze, and the Mitsubishi WS is the same as the Flexi Soft, except it costs more.)

Despite their list prices, both models are <$1000 when configured with 8 outputs.  Both have free software (big kudos to Leuze and Sick!).  Both software programs include a simulator (which is really helpful both for both evaluation and developing).  Both are expandable, which is essential (I’ve been burned too many times by non-expandable systems).

The Leuze MSI 202’s advantages include:

  • It has more inputs.  The base configuration is 20 safe  inputs, 4 safe outputs, and 4 monitoring (non-safe) outputs; each expansion module adds 8 inputs and 4 outputs (or, if you want, 12 inputs / 0 outputs) and 2 monitoring outputs.  The Flexi Soft’s controller has no inputs; each XTIO module add 8 safe inputs and 4 safe outputs.
  • Monitoring is much easier: you can install the software (for free), open the project, enter the project password, and then monitor the project’s internal state (downloading a project requires knowing the PLC’s password).  I like this feature because it can make troubleshooting in the field much easier.  The Flexi Soft doesn’t have an equivalent.

The Flexi Soft’s advantages include:

  • More flexible communications.  You can read and write from a block of memory (not the safety area!), while the Leuze only uses standard digital I/O.
  • Better network support.  The Leuze only supports Profibus-DP via an add-on module, while the Flexi Soft supports Sick’s Flexi Line protocol on some models (which could handy if you’re using other safety equipment from Sick), and,via 7 different add-on modules, CANOpen, DeviceNet, Ethernet/IP, EtherCAT, Modbus/TCP, Profinet, and Profibus-DP.  Note that neither PLC supports networked safety.
  • The Flexi Soft has a greater range of expansion modules.  The Leuze only has one type, while the Flexi Soft has four types.

For my application, the Leuze MSI 202’s advantages were important (I needed 20 inputs), while the Flexi Soft’s advantages were nice, but not necessary.

Some final notes based on using the MSI 202:

  • Overall, the project has gone well.
  • The simulation feature has been very useful trying to get my software written before the machine was wired.
  • The software seems a little slow, and has its quirks, but overall it’s been very usable.
    • I’ve especially learned to be patient when downloading the project to the PLC.  I’ve found it works better to wait until the CFG light blinks before pressing the Confirm button.
  • Safe Function Blocks such as EDM take up a lot of memory, as does the base configuration.  However, even with a reasonably long program, I’m only at ~50% memory used.
  • Communications is via a standard 5-pin mini-USB connector.
  • I choose the version with spring clamp terminal blocks; I really like Leuze’s choice of terminal blocks.  They’re easy to operate terminal blocks with two connections per terminal — really nice!
  • For some reason, Leuze USA is behind the times; if you want the MSI 202 manual and the latest software, go to the Leuze’s European web site (which I linked to at the top).
  • SEMI S2 requires an EMO switch with no software involved, not even a safety PLC.  I still wanted to do EDM (external device monitoring) on the EMO circuit, but the standard EDM Function Block is designed for the safey PLC to control the contactor’s coil, while I have to have EMO switch control the coil.  I was able to work around this with my own EDM logic.

November 22, 2013   No Comments

Robot Primer 5: Motion Controllers

In this post, I take a quick look at how some common automation controllers handle motion.  All of the controllers easily control pneumatics using digital I/O.

Traditional Ladder Logic (PLC and many PACs).

I’m grouping PLCs and PAC’s together because they are often quite similar (the definition of a PAC is nebulous; many PAC’s are simply PLC’s based on x86 CPUs, but are still running ladder logic).

PLCs can easily handle pneumatics, although handling event sequences in ladder logic isn’t as straightforward as it is in programming languages such as BASIC, C, or C#.

Even many low end PLCs such as the Panasonic FP0R and Siemens S7-1200 support motion control via step and direction outputs, which can control stepper drivers or servo drives that accept step and direction. More capable motion control is available through dedicated modules, such as Panasonic’s FPG-PP11 module.

The PLCOpen TC2 Standard makes PLC motion control much better by adding a large number of standard motion control function blocks.

PLC motion programming varies.  For example:

  • The Panasonic FPG-PP approach requires setting up a block of memory with all the desired values, then copying it to a special memory location to start the operation.
  • The PLCOpen approach is simpler: just set the values of the function block.
PLCOpen Absolute Move FB

PLCOpen Absolute Move Function Block

Simple Serial Controller

Simple serial or USB controllers are quite common; examples include Schneider (IMS) MDrive integrated stepper motors, Moog Animatics SmartMotors,  AllMotion stepper and servo drives, and many others. These controllers are OK for simple tasks, but are quite limited in their capabilities (the best you’ll find is simple coordinated motion, gearing, and camming). Although the hardware is often cute, they are almost always a pain to program.

Here is an example AllMotion program that homes or steps through a sequence of 4 positions, based on the state of two inputs:


By the way, this protocol is common is certain industries and is used by many companies besides Allmotion.

Fieldbus Drives

A fieldbus drive is a servo amplifier or stepper drive integrated with a motion controller and a fieldbus interface.  Sometimes the fieldbus drive is integrated onto the motor.  There are way too many vendors to list; a short list would include AMC, Copley Controls, and Elmo Motion Controls.

Standard real time fieldbuses such as CANOpen, EtherCAT, and Ethernet PowerLink support standard motion profiles including torque control, velocity control, homing, profile moves, and PVT (position-velocity-time) moves.

Using the raw motion profile is a bit tedious; moves are set up by writing to the appropriate object’s object dictionary, and you have to deal directly with the protocol (CANOpen, etc).  Copley Controls provides an easier to use interface for C/C++ (CML) or COM (older versions) or .NET (current version) with their CMO library.  I’m surprised that very few other vendors provide comparable software.

Just sending commands to drives works fine if you’re doing basic motion.  For more complex motions, you can either buy a hardware motion controller that uses fieldbus drives (from Parker, ACS, and others), buy a soft controller (from ACS or others) or write your own motion control software.

Here is a sample Python script that performs an absolute move using Copley CMO V2.18:

from win32com.client import Dispatch
cmo = Dispatch('CMLCOM.CANOpenObj')
cmo.BitRate = 500000
cmo.PortName = 'kvaser0'
drive = Dispatch('CMLCOM.AmpObj')
drive.Initialize(cmo, 9)
profile = drive.ProfileSettings
profile.ProfileVel = 20000
profile.ProfileAccel = 100000
profile.ProfileDecel = 100000
drive.ProfileSettings = profile

Motion Controller

The motion controller world is very wide and varied, so this is my summary, not a detailed survey.  Popular brands include Galil, Parker, Delta Tau, ACS, Baldor, Aerotech, Delta, PMD, and MEI.

Motion controllers can be software only, plug-in cards (ISA, PCI, PCIe, VME, etc), or stand-alone (serial, Ethernet, USB, Firewire, etc).

Typical motion control capabilities include coordinated motion, interpolated motion, camming, gearing, and triggers.  Motion inputs include dedicated axis inputs such as limit sensors and encoder inputs (one or two per axis; two allows for separate position (e.g. linear encoder) and velocity (e.g. rotary encoder) feedback).  Motion outputs include servo command (normally +/- 10V analog) and/or stepper command (step and direction) and/or digital fieldbus.  Most controllers also have some general purpose I/O.

Programming methods vary; the four main approaches are the simple command approach (used by Galil and many others; they call it “simple and intuitive”, which might be true if you’re only doing motion), using a BASIC variant (Aerotech, Baldor, and many others), ladder logic (especially IEC-61131 and PLCOpen) or use a PC programming language (so the controller provides a library; this approach was popularized by MEI).  Also, many controllers will can use either the PC library approach or their proprietary language.

The boundaries can blur a bit; when is a controller running ladder logic a PLC or a motion controller?  I’d say when it’s intended for general use (for example a Panasonic FP0R), it’s a PLC, and when it’s intended for motion control with special motion control features (such as a Schneider Lexium Motion Controller), it’s a motion controller.  If it’s intended for both, maybe it’s a PAC (such as the Omron NJ series).

Here’s some sample Galil code showing setting up and moving 3-axes:

SP 20000,20000,50000
AC 100000,200000,500000
DC 100000,200000,500000
PA 50000,100000,-25000

Kinematics Controller

The typical motion controller fails when it comes to dealing with the motion on linked axes.  I know a company that had a prototype SCARA robot, using a MEI controller, that was never sold because programming it would have been too difficult — if you wanted to move the end effector to point XYZT you had to figure out the correct positions for each of the axes.

What you need for robots and other machines with mechanically linked mechanisms is inverse kinematics, which means determining how to move the mechanically connected mechanisms to get the end of the mechanisms where you want it to go.

In the past, pretty much only the dedicated robot controllers supported kinematics and inverse kinematics.  Now, I’m happy to say, it’s a lot more common (my Robot Resources page has some links), especially in controllers targeted for packaging automation.

The PLCOpen standard has optional blocks for coordinated motion that includes standard blocks for kinematic transformations.  These transformations have to be supplied by the vendor, so if a PLCOpen motion controller doesn’t support it, you can’t add it.  Still, this is a big step forward.

I took a quick glance at the PLCOpen standard and a couple of kinematic controllers; my impression is that they still do not yet replicate the capabilities of a dedicated robot controller.

Robot Controller

From what I’ve seen, robot controllers still have the best motion capabilities but they may not be best in terms of communications, integration, or programming power.

Many robot controllers use languages based on either BASIC or VAL; for example, Denso uses a BASIC variant and Adept’s V+ is a VAL variant.  The robot vendors have been adding more options, too, such as:

Robots almost always use brushless servo motors.  Often, the controllers can also control a few extra servo motors, but not stepper motors.  The controllers normally have some built-in digital I/O.

Final Comments

To kind of tie everything together, here’s a summary by motion technology:

  • Pneumatics are easily controlled by all controllers.
  • Stepper motors can be controlled by some PLCs, all simple serial stepper controllers, all fieldbus stepper drives,  and most motion controllers.
  • Servo motors can be controlled by some PLCs, all simple serial servo controllers, all fieldbus servo drives, most motion controllers, and most robot controllers.
  • Robots can be easily controlled by kinematic-capable motion controllers and dedicated robot controllers.

July 31, 2013   2 Comments

Make a Panasonic FP0 Power Cable (AFP0581 Replacement)

PLC Power Cable Parts

PLC Power Cable Parts

I recently bought a FP0-A21 analog I/O unit and since it didn’t come with a power cable, I decided to make one.  Because Panasonic does not provide any part numbers, I had to do a little detective work and searching on Digikey to figure out what to use: Molex 51067 series connectors with Molex 50217 series contacts.

The Panasonic part number for the cable assembly is AFP0581; it is used on the FP0 PLC’s, FP0-A21 analog I/O units, FP Sigma PLC’s, and possibly more.

My parts list is simple:

  • 1 Molex 51067-0300 housing
  • 4 Molex 50217-8000 18-24 AWG tin crimp sockets (I like to get at least one extra just in case I screw up).
  • Brown, Blue, and Green 22 AWG wire.

I found an appropriate crimper, and matched the same order as my existing power cable (see below).

PLC Power Cable Wires

PLC Power Cable Wires

Note that like most crimp connectors, the crimp socket can only fit in one way; hopefully the picture below will help.

Connector Closeup

Connector Closeup

October 14, 2012   No Comments

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   1 Comment

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.
    • Update 11/25/2014: this link no longer works, although the download might still exist elsewhere.p 
  • Automation Direct’s Do-more Designer is a free download and includes a simulator.  It appears to only support ladder logic (no Structured Text).  It can drive I/O (such as Ethernet I/O) from a computer, so it will only run continuously for about an hour.  (Added 7/17/2013)
  • Codesys has CODESYS Control for Raspberry Pi SL.  The free version is limited to 2 hours continuous run-time; a license for 35 Euros removes that restriction, but it’s still restricted for training and testing use only.  Capabilities include EtherCAT master, Modbus TCP Master/Slave, Ethernet/IP scanner, Web Visu, and SoftMotion CNC.  It supports the Raspberry PiFace digital I/O module.  It’s not realtime; expected jitter is 50 to 400 μs.  (Added 11/4/2014)
    • If you’re interested in learning IEC61131 PLC programming, playing with EtherCAT drives or I/O, etc, it’s an interesting product, since you can get started with real hardware for $65-$120 (RPi+PiFace for ~$65, Codesys SL license ~$50).
    • has an online PLC simulator (signup required).
    • And, if you have sophisticated safety requirements, at least three safety PLCs have free simulators.  However, these three are all based on block diagram (like a Siemens’ Logo!), not ladder logic, and are definitely not usable as a standard PLC.
      • Leuze’s software is on this page.  We are currently using the MSI-202, and before we bought it, I successfully used the simulator.  However, it’s not instantly intuitive.  As far as I can tell, the Phoenix PSR-TRIFASE is the same controller, and its software is also free.
      • The Sick Flexi-Soft Designer software is here.  The Flexi-Soft is also sold by Mitsubishi (it is a joint product).  I evaluated this software, too, but we decided the Leuze was a slightly better fit.
      • The Banner XS26 software downloads are available here; I haven’t used it but saw it at Semicon West 2015.
    • Although it’s not free, I should give a mention to Siemens’ Logo! Softcomfort, since its simulator is very easy to use – and very useful, since none of the Logo! models I have used provide any on-line debugging information.  I believe Siemens do offer a free trial.

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   5 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   8 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   5 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