C vs Ladder


Thread Starter

Amr Elaguizy

Hello to everyone:
I was told that there is processors manufactured that could be programmed in C Language and through a PC interface could be programmed in a ladder diagram type software. The advantage I
see is the use of C Language and in some parts of the program, the use of ladder diagram. Which should facilitate changing the program logic on the "fly" (on line), without stopping the program
and downloading and compiling which is required with C language. Who is the manufacturer, if any?



Warren Postma

We have used the GE Fanuc 90-30 series PLCs, and their C Coprocessor modules. The benefit of this is that the C coprocessor is completely a
separate card, with access to the same IO, and read/write access to the ladder logic CPU's memory, thorugh the backplane, but if one CPU is put out of run mode, the other keeps running.

The C toolkit (programming software) for the 90-30 PCM (programmable coprocessor module) was expensive, and it used an ancient C compiler which again is purchased separately (Microsoft C version 6), but like your ladder tool, once purchased it was reusable on every project. The C programs it generated had no runtime fees and could be uploaded to the C coproccessor by
customers, using a little utility program that GE has. We also had configuration text files which could be uploaded to the PCM, and we also used the register memory of the PLC to configure the coprocessor, which can be superior since you can reconfigure your PCM code through your MMI. Since
the C code linked to proprietary GE libraries we couldn't simulate the C code's functions on our desktop machines. That meant you made a change,
compiled, uploaded, ran, saw what you could see using printed output, corrected stuff, and tried again. Not exactly a sophisticated debugging
toolset, but you could make do, and we did.

One downside to all this was that the PCM was not accessible throught the same serial link as the GE 90-30's main CPU, so you needed to have TWO
separate serial connections to the PLC rack in order to get full control of it. For our uses this turned out to be fine. Now that PLCs are often connected by Ethernet, this "schizo" design will be even more annoying, but you can definitely work around it.

Another way to do this which has it's own disadvantages, would be to use a single embedded PC (single board or PC-104 or something like that), and buy a ladder logic engine which you can link to your C program. There are several of those around, ISAGRAAF is the one I remember seeing. I think C programming is best done for the purpose of generating generic reusable
modules, which can be loaded and unloaded (such as the GE-90-30 PCM, or by using a .DLL approach on a PC) as optional features. Having a monolithic C program has been a terrible maintenance and service nightmare for us, and we
avoid doing that now.

A third alternative is the WinPLC (I forget who sells this). This looks kind of "bleeding edge" to me, but it could be interesting. It is a PLC
running Windows CE. You can develop with MS Visual C++, MS Visual Basic, and I think there is even a Java JVM coming, plus it has a Ladder Logic/IEC-1131 engine running inside Windows CE. This looks to definitely be the future of PLCs.

Warren Postma
ZTR Control Systems
I don't know if this answers your question, but there are PLC manufacturers that allow you to essentially write your own ladder functions using C. You compile the function, and it can be called
from within your ladder logic.

For example, SoftLogix by Rockwell Software (Allen-Bradley) lets you create such functions. This is a SoftPLC platform running on NT. I believe you can also do the same type of thing on their Controllogix platform. I've been told that the Siemens PLC programming software also let's you do this.

Hope this helps.

Ed Diehl
Ph (541) 791-8140
Fax (541) 791-8130
Cell (503) 510-3415