Programming methods for Rockwell AB programmable logic controllers (PLCs)
2026-04-06 08:50:21··#1
Abstract: This paper introduces the programming methods (ladder diagram, structure text, sequential function chart, etc.), instruction system, and programming tools (programming software and equipment) of Rockwell AB programmable logic controllers (PLCs). Keywords: Programmable logic controller; instruction; programming software Rockwell AB PLCs are increasingly widely used in the field of automation due to their support for multiple programming methods, rich programming instructions, and the availability of corresponding programming and debugging simulation software for each series of PLCs. I. Programming Methods All AB PLCs (Micrologix1000, SLC500, PLC-5, and Controllogix) support ladder diagram programming, while most PLC-5 series processors (enhanced and higher series) also support structure text and sequential function chart programming methods. 1. Ladder Diagram The ladder diagram is the most typical and basic programming method. It uses a graphical language, retaining the terms and graphic symbols of relay contacts, coils, series and parallel connections, and adding some symbols not found in relay contact control. Ladder diagrams are visual and intuitive, making them easy to understand for those familiar with relay representations without requiring deeper computer knowledge. This is one of the most widely used programming methods, suitable for sequential logic control, discrete quantity control, timing/counting control, and other operations. A ladder diagram typically consists of multiple different steps, each of which can be composed of one or more input instructions and one output instruction. The output instruction should appear on the far right of the step, while the input instruction appears to the left of the output instruction, as shown in Figure 1. [align=center] Figure 1[/align] 2. Structured Text Structured text is similar to BASIC programming, allowing for convenient creation, editing, and implementation of complex algorithms, particularly effective in data processing, computation and storage, decision-making, and optimization algorithms involving variables describing multiple data types. For PLC-5 processors, the structured text supports the following structures: Assignment: Assign an integer or floating-point value to a data unit. Non-holding bit assignment: Assign a binary number to a bit unit; these bits are cleared when the processor switches from programming mode to running mode or after a step in the Sequential Function Chart (SFC) is scanned. Retaining bit assignment: Assigning a binary number to a bit unit, these bits are not cleared when the processor switches from programming mode to run mode or after the SFC step is scanned. IF-THEN-ELSE: Conditionally executes a program. FOR-NEXT: Repeats execution of a program. WHILE: Repeats execution of a program as long as the input expression is true. REPEAT: Repeats execution of a program until a certain input expression is true. EXIT: Exits the loop structure (REPEAT, FOR, or WHILE) before the processor reaches a normal termination condition. CASE: Conditionally executes a program based on the value of a mathematical expression or operand; ;: Equivalent to a no-operation instruction NOP. Ladder diagram function: Can call any ladder diagram program or instruction. Below is a programming example using structured text: IF (T4:0.DN) THEN TON (T4:0,0.01,100,0) ELSE RES (T4:0) END-IF 3. Sequential Function Chart (SFC) SFC is a sequential control language that allows you to control a process and display its state. For user applications, logic can be divided into manageable steps and transitions instead of longer ladder diagrams or structured text. Each step in an SFC corresponds to a control task (actually a program to complete a specific control task, which can be a ladder diagram, structured text, or SFC), represented by a box. There are transition conditions (also a program) between steps. By checking these conditions, the processor is determined when to start executing the next step. Transition conditions are represented by horizontal lines. By displaying these steps and transition conditions, you can see the state of a machine process at any given time. A simple SFC program example is shown in Figure 2. [align=center]Figure 2[/align] II. Instruction System AB PLCs have a rich instruction system (approximately 110 instructions). Although different PLC series support different types of instructions, some basic instructions are common. The following mainly introduces the instruction types of the PLC-5 series programmable controller. 1. Relay Instructions Relay instructions are used to monitor the bit status in a data table, such as input bits or bits in a timer control word. Relay instructions include: Check On (XIC); Check Off (XIO); Output Excitement (OTE); Output Latch (OTL); Output Unlock (OTU); Immediate Input (IIN); Immediate Output (IOT). 2. Timer/Counter Instructions Timer and counter instructions are used to control operations based on time and event counting, including: On Delay Timer (TON); Off Delay Timer (TOF); Retain Timer (RTO); Up Count (CTU); Down Count (CTD); Timer/Counter Reset (RES). 3. Comparison Commands: Comparison commands are used to compare expressions or specify the value of a comparison command. They include: Compare (CMP); Equal to (EQU); Greater than or equal to (GEQ); Greater than (GRT); Less than or equal to (LEQ); Less than (LES); Limit Test (LIM); Masked Equality Comparison (MEQ); Not equal to (NEQ). 4. Calculation Commands: Calculation commands are used to calculate expressions or perform arithmetic operations using specified arithmetic commands. They include: Calculate (CPT); Multiply (MUL); Invert (NEG); Sine (SIN); Square Root (SQR); Sort (SRT); Subtract (SUB); Tangent (TAN); Arcsine (ASN); Arccosine (ACS); Logarithm (LOG); Natural Logarithm (LN); Division (DIV); Cosine (COS); Clear to Zero (CLR); Average (AVE); Arctangent (ATN); Addition (ADD); Standard Deviation (STD); X raised to the power of Y (XPY). 5. Logical Instructions: Logical instructions are used for logical operations, including: AND; NOT; OR; XOR. 6. Conversion Instructions: Conversion instructions are used for conversions between integers and BCD, and between degrees and radians, including: Integer to BCD (TOD); BCD to Integer (FRD); Radius to Degree (DEG); Degree to Radius (RAD). 7. Bit Manipulation and Transfer Instructions: Bit manipulation and transfer instructions are used for bit adjustment and bit transfer, including: Bit Assignment (BTD); Word Transfer (MOV); Mask Transfer (MVM). 8. File Instructions: File instructions are used for operations on and comparisons of file data, including: File Arithmetic and Logical Instructions (FAL); File Search and Comparison Instructions (FSC); File Copy (COP); File Fill (FLL). 9. Shift Instructions: Shift instructions are used to simulate the movement or flow of components and information, including: Bit Left Shift (BSL); Bit Right Shift (BSR); First-In-First-Out Load (FFL); First-In-First-Out Unload (FFU); Last-In-First-Out Load (LFL); Last-In-First-Out Unload (LFU). 10. Program Control Instructions: Program control instructions can change the direction of ladder diagram program execution, including: Jump (JMP); Disable User Interrupts (UID); Always False Instruction (AFI); Label (LBL); Allow User Interrupts (UIE); Temporary End (TND); Abort (BRK); Loop (FOR, NXT); SFC Reset (SFR); Subroutine (SBR); Jump to Subroutine (JSR); Return (RET); Master Reset (MCR); End of Transition (EOT). 11. I/O Information Instructions: Used for information transfer, including reading and writing to block transfer modules on local or remote I/O frameworks, and information transfer between processors. Block Transfer Write (BTW); Block Transfer Read (BTR); Information Message (MSG). Additionally, there are sequencer instructions for controlling automated production lines with continuous and repetitive operations (such as Sequential Input SQI, Sequential Output SQO, Sequential Load SQL), PID instructions for process control, diagnostic instructions for monitoring user programs, and ASCII instructions, etc. This large number of instructions allows users to select appropriate instructions during program development, significantly saving development time. III. Programming Software and Equipment Rockwell AB's various PLC series all have corresponding programming and simulation software. Table 1 lists some widely used programming software for various PLC series. Table 1. PLC Programming Software PLC Series: PLC-5, SLC-500, or Micrologix 100 Programming Software: PLC-5 AI Series: SLC500 AI Series: RSLogix5, RSLogix500 Simulation Software: RSEmulute5, RSEmulate500 The AI series programming software is an MS-DOS-based package that enables offline and online development, documentation, and reporting for various AB PLC processors. Due to its menu and function key features, AI software is easy for beginners to use, and its powerful editing and diagnostic tools save significant time in ladder diagram development and fault detection. The help system helps users familiarize themselves with the software's features and provides detailed information on the PLC instruction set. RSLogix5 and RSLogix500 are Microsoft 32-bit packages running on Windows 95 or Windows NT. They provide every feature users desire, such as a fully graphical user interface, a flexible and easy-to-use editor, point-and-click input/output configuration, a powerful database editor, diagnostic and troubleshooting tools, and reliable communication. Therefore, RSLogix programming solutions are suitable for developers of all levels. Most importantly, RSLogix products are fully compatible with programs generated by the previous MS-DOS-based Rockwell programming software, making cross-platform programs easy to convert and maintain. Therefore, the RSLogix series is more suitable for modern programming. Before starting and running, it is essential to test and debug the programmed code. The RSEmulate series simulation software package can be used to simulate one or more running SLC500 or PLC-5 processors (RSEmulate500 simulates SLC500, RSEmulate5 simulates PLC-5). The RSEmulate series simulation software is also a Microsoft Windows-based package. Besides simulating SLC500 and PLC-5, it can also be used for fault detection, ladder diagram scanning options, serial device simulation, etc., making it very convenient to use. For various Rockwell AB PLC series, we can program them using different communication methods and different programming devices. Common programming devices include personal computers (386 or above) and AB-specific programmers. We can program AB PLCs one-to-one via the programmer's serial port, or program multiple PLCs via a network: for example, programming a PLC-5 on a DH+ network (Figure 3), or programming an SLC500 on a DH-485 network (Figure 4), etc. For the SLC500 or Micrologix1000, we can also use a handheld programmer (HHT). [align=center] Figure 3 [/align] IV. Conclusion In summary, AB PLCs, due to their support for multiple programming languages, rich and advanced instruction sets, and the wide variety, powerful functions, and ease of use of their programming software, are easily familiarized by designers and users. They can also easily implement applications such as high-speed sequential control, motion control, and drive system control. Therefore, the application prospects of AB PLCs in the field of automation are very broad.