Copyright Goodheart-Willcox Co., Inc. Chapter 6 PLC Programming 99 6.4 PLC Program Scan Time When the processor runs through the PLC program, the PLC program execution flow, called program scan, on each rung is from left to right. Moving through the entire PLC ladder logic diagram, the program scans from the top rung to the bottom rung. Therefore, instructions in the PLC ladder logic diagram are scanned starting from the instruction in the upper-left corner and ending with the instruction on the lower-right corner. The operational scan rate is the time required to execute the PLC ladder diagram once. After the last instruction in the lower-right corner is executed, the process of scanning restarts. Figure 6-19 illustrates one scan cycle for a PLC ladder diagram. Each PLC operational cycle has three separate scan parts: input scan, program scan, and output scan. These three PLC scan sections can be described as follows: • Input scan: The processor reads the input ports and updates the input status table. • Program scan: The processor executes the PLC program and updates the output status table. • Output scan: Output status table values are transferred to the output terminals. When a rung is scanned, its input and output addresses are updated. However, because the scanning takes place from left to right across each rung, and from the top to bottom rungs, sometimes specific inputs or outputs may not be updated in time. For example, assume the scan time for a ladder program is 6 milliseconds, but the status of an input port changes every 3 milliseconds. This results in missing the status of that input port every other time. In order to correct this problem, an instruction called immediate input with mask (IIM) is placed in the middle of the program. This instruction causes the critical input to be read twice within a 6-millisecond period. A similar instruction called immediate output with mask (IOM) can be used for the output port(s). IOM causes the critical output port to be read twice within a 6-millisecond period. Single-bit instructions in PLC ladder logic diagrams are displayed in Table 6-3. The single-bit instructions examine if closed and examine if open are used for NO and NC inputs, respectively. Examine if closed (XIC) instructs the program to examine an NO input device if it is closed. Examine if open (XIO) instructs the program to examine an NC input if it is open. Output energize (OTE) represents the output port that is connected to an output device. Output latch (OTL) and output unlatch (OTU) are used for latch/unlatch instructions and are covered in this chapter. One-shot rising (OSR) is a one-shot output instruction used to generate a one-shot pulse. You will learn more about these instructions in later chapters. Goodheart-Willcox Publisher Table 6-3. Single-bit instructions for controlling input and output data. Instruction Instruction Full Name Description XIC Examine if Closed Examines a normally open bit for an ON condition XIO Examine if Open Examines a normally closed bit for an OFF condition OTE Output Energize Turns ON a bit or an output port (non-retentive) OTL Output Latch Latches a bit (retentive) OTU Output Unlatch Unlatches a bit (retentive) OSR One-Shot Rising Turns ON a bit for one scan only Output scan Input scan Program scan Goodheart-Willcox Publisher Figure 6-19. PLC scan cycle.