QUOTE(MotherPuncher @ Nov 19 2008, 06:41 PM) [snapback]75961[/snapback]
Hey all,
I'll try to keep this short. Our company makes purpose built controllers for a niche market. Currently, they're programmed in C, but we would like to try programming them in ladder logic. In researching doing this, I couldn't find any data on how much memory the operating software on a PLC is.
So what I'm asking is what is the amount of space required for the software on a PLC processor? Not the user program or program data, but the actual operating software that handles the ladder logic and executes the commands.
Thanks in advance
You don't really have access to the "operating system" in a PLC. At best, you might be able to flash a different firmware, which is effectively the OS. Some (many) PLC's effectively have a compiler built into the ladder editting software. Others are nothing more than tokenizers that simply stick byte codes into the PLC. The hardware can get downright strange. There are at least 3 different CPU's inside of a PLC-5 that I was able to identify plus multiple ASIC's that actually make up the "interpreter" or operating system or whatever you want to call it. The ControlLogix PLC has at least 2 separate CPU's (one for IO and one for programs). Memory models are similarly goofy. Depending on the make/model the PLC "ladder" might even be fixed size rows within the memory. They didn't come right out and say it but it was very obvious that this was the structure of the old Square D PLC's (no longer produced). You also don't get involved as much in actually "compiling" the code. Code gets compiled almost on a line-by-line basis. From a user point of view, there's no separate "object code" or "binaries" to deal with. The program IS the program.
If you are switching over from "C", then I suggest as others have that you go one of two routes. Either adopt structured text which is very similar to C, or go with one that can run compiled programs. At one time, AB was selling the 1771-DMC module which was literally a complete embedded processor running OS-9 on an IO card that sat right alongside the PLC. I would strongly discourage you from even considering using that thing though. I have exactly one spare just in case I need it. After August, 2009, it's going in the trash bin or else getting sold on one of those "spare parts" web sites.
Instead, another model of PLC to consider is www.softplc.com. This PLC is very similar in terms of programming languages to the Allen Bradley PLC-5 (partly because the owner/author was on the PLC-5 development team). It runs on more or less stock industrial PC hardware on Linux. It already has built-in protocols for doing most of the common PLC remote IO networks. It can have "local" IO but these days, local IO tends to be overrated (and expensive) in many cases anyways. The really neat part for your application is that you can extend the base ladder logic language with either C++ or Java user functions. There's no "C-like" language at all to deal with. You will be able to use all of Allen Bradley's hardware except for the base PLC hardware.