The Straight Talk on PC Based Machine Logic Controllers

I keep hearing that PC based logic is going to take over the industry. What's this all about?

For at least ten years, We've been hearing that PLC's were on the way out. The wave of the future was to be PC based soft logic controls that would be much cheaper and powerful than PLC’s. The idea was that because everybody was making PC hardware, and the consumer demand for these products was high, the hardware would get to be real cheap. You would be able to buy a "white-box" or anybody’s computer, hook some I/O to it, and off you go. This line of thinking was driven by the fact that the PLC market is controlled by a limited number of vendors. Because they enjoyed a virtual lock on the market, they could afford to be somewhat customer hostile.

The problem was nobody wanted to jump on the Beta-Test Bandwagon. There were also limited options for I/O on these systems. Most of the I/O was not really industrially hardened, and was better suited for laboratory applications. There were a few industrial networks for remote I/O, but the acceptance of them was slow, because most of them were foreign. Check our Straight Talk on Industrial Networks for more info. Basically, the situation has changed in that now there are many more accepted forms of Industrial I/O networks that lend themselves to this application.

At this point, the PC based logic control market seems to have about 10% of the industrial controller market. This puts it about where PLC’s were in the late 1960’s when they took over the market from hard wired relay logic.

So what is PC based logic?

In a nutshell, it means you take out your PLC and put in a PC that runs your machine. Some kind of software that runs on the PC hardware will simulate the actions of a PLC to control your machine.

Why would I want to do that?

There are a few reasons. First of all, you probably aren’t going to use this on a project that you can do with a brick PLC. The base cost will be too high. But if you have a project that has a reasonable amount of I/O and an MMI, then you would logically look at doing away with your PLC. I mean, you’ve got a computer in the touchscreen, right? Why not use it?

There is also the need to incorporate SCADA and other kinds of data collection and transfer to and from a process on the floor from the main management system. Since the line between front office management and plant floor production and control are being blurred, there is a need for more compatible hardware between the two.

The other main reason you would take this approach would be to have the flexibility to program in something other than ladder logic. Let’s face it, doing a bunch of math in ladder logic can be a real pain. The real high end PLC’s may program in other "languages" but at that point, refer to the paragraph above. You may be throwing away horsepower, which in industrial hardware cost terms can be real expensive.

But I like ladder logic!

You have a lot of company. Most people are comfortable with ladder logic, which is why most PC based control systems have left you the option of programming in ladder logic.

One of the biggest problems with PLC’s is that the programming look kind of the same between brands and processors, but basically they were all custom made and proprietary to that processor. Many times, you had to have specific knowledge of that processor to be able to use the functions properly. That meant that there had to be somebody in the plant that knew Omron, one that knew Allen Bradley, etc. Your option was to have a plant standard, but you could paint yourself into a corner real quick if the company you chose isn’t staying on the cutting edge of technology.

A few years ago, the European market came with a programming standard that makes the look and feel the same for machine logic control. This meant that the data tables and function declarations would be the same, so you wouldn’t need any product specific information to write basic programs. This standard is called 1131-3.

Ok, so what kind of hardware are we talking about?

In a PLC based system, you have a layout that looks like this:

In a PC based system, you do away with the PLC and replace it with some I/O interface, like this:

That’s the main hardware difference. The PC can be a variety of platforms, from a Gateway to a CTC PowerStation. Basically, they will have Intel-compatible processors, and will have similar requirements for video, ram and mass storage space as you will need for a computer running a decent sized OPI package like Interact or WonderWare.

You will probably want to stick with industrial style PC platforms, as they tend to be more proven in the environment.

Does it run under Windows?

The short answer is no. Let’s start by looking at the three flavors of Windows.

Windows 3.1, Windows for Workgroups, Windows 95,98.

There are some basic problems with these operating systems that make them unsuitable for machine control. First of all, none of them are deterministic . They were also all written for client style office use, like word processing or spreadsheets or consumer type use, like gaming or Internet browsing. In this application, a completely stable system isn’t necessary. The big issue with this application is cross compatibility, in that it has to be able to support a huge range of hardware, from video cards to bus controllers. If the system crashes, you reboot and go on with it.

Obviously, crashes are completely unacceptable for machine control. Due to the instability of the Windows platform, nobody in the industry uses it for machine control. Most of the PC based OPI software can run under Windows. The theory here is that you’ve got a PLC actually making the machine move, so if the OPI crashes, you can shut down the machine in an orderly fashion to allow you to reboot your OPI. Because straight Windows is likely to crash, the manufacturers recommend that you use Windows NT for the OPI software. None of the makers of PC based machine logic software will run under straight Windows.

Windows NT

Windows NT is a version of Windows that was released to allow a more stable operating environment for networking applications. Obviously if you had an entire office running on a network and the servers crashed, you would have problems. Likewise the clients crashing can cause problems as well. The basic kernel of the Windows NT system is different from the Windows 95 kernel. In order to increase the reliability of Windows NT, there is a specific, although large, hardware list that is compatible. That was a pretty good strategy, and Windows NT is a good bit more stable than Windows 95. But it still crashes. And it’s still not deterministic .

Windows CE

Windows CE was basically written as an operating system for palmtop and pocket computers. For that application, it’s probably Ok. A lot of people got excited about this OS because they thought it would be small and uncomplicated enough that it wouldn’t have the stability problems of Windows 95 and NT.

The problem is that each version of Windows CE is specifically written for the hardware it is running on. It has a lot of software compatibility problems, in that programs that run on one palmtop well may not run at all on other brands of palmtops.

This version is not deterministic either. A few companies have put out versions of software that run under CE, but from what I’ve seen, they either don’t work or they are basically PLC’s running CE. And we were trying to get rid of our PLC’s, right?

So how does it work?

Well, we’ve ruled out Windows 95, 98, because it’s too unstable. We don’t like CE because it’s proprietary.

So we’re left with Windows NT. The problem with NT is that it still can crash. The good part about Windows NT is that you can separate the Windows operating system from the actual hardware to increase the reliability.

A few notable companies, like SteepleChase, have made a fairly good stab at solving this problem. They boot the root system with a non-Windows shell that basically adds the real time extensions that are needed to allow a deterministic system. It also takes over all the basic I/O functions for the system, so there is much more fault tolerance to hardware failures. The machine logic runtime program is then loaded on top of this shell to actually run the machine, and then Windows NT is loaded on top of that. This allows you to run your OPI or SCADA process under Windows NT and let the machine logic run almost independently. I’ve even seen a demonstration where a machine was running and the salesman opened up the computer case and took out the hard drive. The machine kept running. Unfortunately, very soon, Windows NT crashed. That meant the OPI crashed, and you could no longer see what was going on.

If Windows NT crashes, the machine logic portion of the process continues to run, and you can perform an orderly shutdown of the system to allow you to start it up again.

Wow, that still leaves me at the mercy of Bill Gates’ office software. What can I do?

Real simple. Don’t play. CTC has come up with a system that does away with Windows as a run time operating system. For some time, they have produced an OPI that runs basically on top of MS-DOS, which is old, but real stable. When they came out with their machine control software, they took the same approach.

MachineLogic has a basic operating system that has been used in Europe for years called RTX-DOS. It’s not a Microsoft product, but has all the basic functionality of MS-DOS. What it adds is the real time extensions that are needed for a true deterministic system. The hardware is all PC based, so you get the option of running any kind of box you want. There is one card that must be installed for MachineLogic to run, and it adds a real time clock with a watchdog timer, and true retentive memory, so in the event of a power or hardware failure, the current values are already saved, just like a PLC.

CTC also licensed its runtime PLC kernel from a company that writes operating systems for PLC’s, meaning the code has been running out there for years. You don’t have to go through that development cycle.

What about hardware reliability?

Like I said before, you probably want to run some industrially hardened version of a PC, as it will be built to deal with the rough atmospheric conditions inside a plant, what with heat, cold vibration and all.

The most unreliable piece of hardware in a PC is probably the hard drive. There’s roughly a 300,000-hour MTBF (mean time between failures) with a one-year replacement rate of around 2.0%. Moving to a flash card will increase your MTBF to over 1,000,000 hours, with a one-year replacement rate of less than 0.3%

How’s the development software work?

The development software runs under Windows 95 and up, and hooks to the actual controlling software through the serial port, or optimally through a TCP/IP connection. From here, you can do real time program monitoring and patching.

Did you say real time monitoring and patching?

Yep, you can look at all the variables on line, while the program is running. No more writing special code and traps to find where your program jumped into the weeds. It's all right there! You can also update programs while the tasks execute.

What’s the downside of MachineLogic?

You can’t run anything on the PC with MachineLogic controlling a machine except MachineLogic and Interact, which is the OPI software. This means that any third party software package can't run on this PC. However, Interact can run as a data server for the higher level data analysis packages that will be running on the supervisory system.

The upside to this is there's no chance of rogue software bugs taking out your machine, because there's a limited number of drivers, and all of them are thoroughly tested by CTC.