L ANGUAGES AND I NSTRUCTIONS

L ANGUAGES AND I NSTRUCTIONS

The IEC 1131-3 standard defines two graphical languages and two text- based languages for use in PLC programming. The graphical languages use

symbols to program control instructions, while the text-based languages use character strings to program instructions.

Graphical languages • ladder diagrams (LD) • function block diagram (FBD) Text-based languages • instruction list (IL) • structured text (ST)

Additionally, the IEC 1131-3 standard includes an object-oriented program- ming framework called sequential function charts (SFCs). SFC is sometimes categorized as an IEC 1131-3 language, but it is actually an organizational structure that coordinates the standard’s four true program- ming languages (i.e., LD, FBD, IL, and ST). The SFC structure is much like

a flowchart-type of programming framework, utilizing different languages for different control tasks and also routing control program actions. The SFC structure has its roots in the early French standard of Grafcet (IEC 848).

The IEC 1131-3 standard is a graphic/object-oriented block programming method, which increases the programming and troubleshooting flexibility of

its programmable controllers. It allows sections of a program to be individu- ally grouped as tasks, which can then be easily interlocked with the rest of the program. Thus, a complete IEC 1131-3 program may be formed by many small task programs represented inside SFC graphic blocks. The combination of languages available in the IEC 1131-3 standard also enhances PLC programming and troubleshooting by providing not only a better program- ming language, but also a better method for implementing control solutions.

The IEC 1131-3 uses a wide variety of standard data functions and function blocks, which operate on a large number of data variable types. Table 10-1 shows some examples of these data types and functions, as well as some typical function blocks. Data variable type refers to the kind of data received by the controller (e.g., binary, real numbers, time data, etc.), while data functions are the operations performed on the data (e.g., comparison, invert,

Industrial Text & Video Company 1-800-752-8398

www.industrialtext.com

S ECTION PLC The IEC 1131 Standard and C HAPTER 3 Programming

Programming Language 10

addition, etc.). Function blocks are sets of data function instructions that work on blocks of data. Moreover, variable scope refers to the extent that a variable can be used in an application. For example, global variables can be used by any program in an application, while local variables can only be used by one particular program. Note that, in addition to the standard types of variables, functions, and blocks, the IEC 1131-3 allows for other types of vendor- and user-defined PLC programming elements. Thus, the IEC 1131-3 does not specify a set number of programming features, but rather establishes the groundwork for standard and additional functions.

• S e t / r e s e t — b i s t a b l e — l a t c h / u n l a t c h • E d g e t r i g g e r d e t e c t i o n (=, , ) ( π , ≠ , ↓ )

Table 10-1. Data variable types, functions, and blocks.

The IEC 1131 standard’s data type and function flexibility allows programmable controller manufacturers to provide instructions they consider necessary, but that are not defined within the standard. Such instructions may include specific application instructions, such as a servo positioning instruction used with a particular vendor’s intelligent servo control module. While this instruction may fall within the programmability parameters of the standard, it may not be available in other PLCs that comply with the standard. Thus, the IEC 1131 standard lets vendors enhance their IEC 1131-3 instruction sets by adding more powerful, customized instructions. It also allows users to create their own instructions, in block form, to perform a specific task.

Industrial Text & Video Company 1-800-752-8398

www.industrialtext.com

S ECTION PLC The IEC 1131 Standard and C HAPTER 3 Programming

Programming Language 10