PLC programs are typically written in a special application on a personal computer, then downloaded by a direct-connection cable or over a network to the PLC. The program is stored in the PLC either in battery-backed-up
RAM or some other non-volatile
flash memory. Often, a single PLC can be programmed to replace thousands of
relays.
Under the
IEC 61131-3 standard, PLCs can be programmed using standards-based programming languages. A graphical programming notation called
Sequential Function Charts is available on certain programmable controllers. Initially most PLCs utilized Ladder Logic Diagram Programming, a model which emulated electromechanical control panel devices (such as the contact and coils of relays) which PLCs replaced. This model remains common today.
IEC 61131-3 currently defines five programming languages for programmable control systems: FBD (
Function block diagram), LD (
Ladder diagram), ST (
Structured text, similar to the
Pascal programming language), IL (
Instruction list, similar to
assembly language) and SFC (
Sequential function chart). These techniques emphasize logical organization of operations.
While the fundamental concepts of PLC programming are common to all manufacturers, differences in I/O addressing, memory organization and instruction sets mean that PLC programs are never perfectly interchangeable between different makers. Even within the same product line of a single manufacturer, different models may not be directly compatible.