0% found this document useful (0 votes)
46 views3 pages

8.2.1 The Input and Output Scans

The document discusses how PLCs operate by scanning inputs, executing ladder logic programs, and then scanning outputs. During the input and output scans, values are copied between physical devices and memory. The ladder logic execution uses the values stored in memory rather than directly reading inputs or controlling outputs. It also describes common PLC components like status lights and memory types used in PLCs like RAM, ROM, EPROM, and EEPROM.

Uploaded by

Anonymous DKv8vp
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
46 views3 pages

8.2.1 The Input and Output Scans

The document discusses how PLCs operate by scanning inputs, executing ladder logic programs, and then scanning outputs. During the input and output scans, values are copied between physical devices and memory. The ladder logic execution uses the values stored in memory rather than directly reading inputs or controlling outputs. It also describes common PLC components like status lights and memory types used in PLCs like RAM, ROM, EPROM, and EEPROM.

Uploaded by

Anonymous DKv8vp
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

130

8.2.1 The Input and Output Scans


When the inputs to the PLC are scanned the physical input values are copied into memory. When the outputs to a PLC are scanned they are copied from memory to the physical outputs. When the ladder logic is scanned it uses the values in memory, not the actual input or output values. The primary reason for doing this is so that if a program uses an input value in multiple places, a change in the input value will not invalidate the logic. Also, if output bits were changed as each bit was changed, instead of all at once at the end of the scan the PLC would operate much slower.

8.2.2 The Logic Scan


Ladder logic programs are modelled after relay logic. In relay logic each element in the ladder will switch as quickly as possible. But in a program elements can only be examines one at a time in a fixed sequence. Consider the ladder logic in Figure 92, the ladder logic will be interpreted left-to-right, top-to-bottom. In the figure the ladder logic scan begins at the top rung. At the end of the rung it interprets the top output first, then the output branched below it. On the second rung it solves branches, before moving along the ladder logic rung.

3 4

11

10

Figure 92

Ladder Logic Execution Sequence

The logic scan sequence become important when solving ladder logic programs which use outputs as inputs, as we will see in Chapter 8. It also becomes important when considering output usage. Consider Figure 93, the first line of ladder logic will examine input A and set output X to have the same value. The second line will examine input B and set the output X to have the opposite value. So the value of X was only equal to A until the second line of ladder logic was scanned. Recall that during the logic scan the outputs are only changed in memory, the actual outputs are only updated when the ladder logic scan is complete. Therefore the output scan would update the real outputs based upon the second line of ladder logic, and the first line of ladder logic would be ineffective.

131

X X

Note: It is a common mistake for beginners to unintentionally repeat the same ladder logic output more than once. This will basically invalidate the first output, in this case the first line will never do anything.

Figure 93

A Duplicated Output Error

8.3 PLC STATUS


The lack of keyboard, and other input-output devices is very noticeable on a PLC. On the front of the PLC there are normally limited status lights. Common lights indicate; power on - this will be on whenever the PLC has power program running - this will often indicate if a program is running, or if no program is running fault - this will indicate when the PLC has experienced a major hardware or software problem These lights are normally used for debugging. Limited buttons will also be provided for PLC hardware. The most common will be a run/program switch that will be switched to program when maintenance is being conducted, and back to run when in production. This switch normally requires a key to keep unauthorized personnel from altering the PLC program or stopping execution. A PLC will almost never have an on-off switch or reset button on the front. This needs to be designed into the remainder of the system. The status of the PLC can be detected by ladder logic also. It is common for programs to check to see if they are being executed for the first time, as shown in Figure 94. The first scan or first pass input will be true the very first time the ladder logic is scanned, but false on every other scan. In this case the address for first pass in ControlLogix is S:FS. With the logic in the example the first scan will seal on light, until clear is turned on. So the light will turn on after the PLC has been turned on, but it will turn off and stay off after clear is turned on. The first scan bit is also referred to at the first

132

pass bit. first scan S:FS light clear light

Figure 94

An program that checks for the first scan of the PLC

8.4 MEMORY TYPES


There are a few basic types of computer memory that are in use today. RAM (Random Access Memory) - this memory is fast, but it will lose its contents when power is lost, this is known as volatile memory. Every PLC uses this memory for the central CPU when running the PLC. ROM (Read Only Memory) - this memory is permanent and cannot be erased. It is often used for storing the operating system for the PLC. EPROM (Erasable Programmable Read Only Memory) - this is memory that can be programmed to behave like ROM, but it can be erased with ultraviolet light and reprogrammed. EEPROM (Electronically Erasable Programmable Read Only Memory) - This memory can store programs like ROM. It can be programmed and erased using a voltage, so it is becoming more popular than EPROMs. Hard Disk - Software based PLCs run on top of another operating system (such as Windows) that will read and save values to a hard drive, in case power is lost. All PLCs use RAM for the CPU and ROM to store the basic operating system for the PLC. When the power is on the contents of the RAM will be kept, but the issue is what happens when power to the memory is lost. Originally PLC vendors used RAM with a battery so that the memory contents would not be lost if the power was lost. This method is still in use, but is losing favor. EPROMs have also been a popular choice for programming PLCs. The EPROM is programmed out of the PLC, and then placed in the PLC. When the PLC is turned on the ladder logic program on the EPROM is loaded into the PLC and run. This method can be very reliable, but the erasing and programming technique can be time consuming. EEPROM memories are a permanent part of the PLC, and programs can be stored in them like EPROM. Memory costs continue to drop, and newer types (such as flash memory) are becoming available, and these changes will continue to impact PLCs.

8.5 SOFTWARE BASED PLCS


The dropping cost of personal computers is increasing their use in control, including the replacement of PLCs. Software is installed that allows the personal computer to solve ladder logic, read inputs from sensors and update outputs to actuators. These are important to mention here because they dont obey the previous timing model. For example, if the computer is running a game it may slow or

You might also like