RsLogix 500 - XIC XIO OTE Program Scan Step by Step

In this lesson we are going to walk through the step by step execution of the program you created in the RsLogix 500 Basic ON/OFF Control XIC XIO OTE lesson. 

Open it back up and go online with the processor.

You should recognize the image below from the RsLogix 500 - PLC Scan Cycle lesson.  We have added output O/1 and the program above to it.  We are going to walk through the PLC scan of this program step by step.  Proceed to the next image.

xic-xio-program-scan-explaination1.png

For the following explanation Button 1 is not pressed, both Light 1 and Light 2 are off to start with.  Below the following image you will see an explanation of the steps of the PLC scan.

xic-xio-program-scan-explanation-details-beginning2.png

1.  The PLC updates its input data table values based off of the physical states of the inputs.  Since Button 1 is not pressed and the indicator for input 0 in the PLC screen is not illuminated, it puts a "0" in the I:0/0 box.

2.  The PLC begins executing the ladder logic with the very left instruction of rung 0.  The XIC instruction has different meanings associated with it, but the most basic and reliable meaning is the "1" in the I:0/0 data box.

3.  The PLC looks in the I:0/0 data box and sees there is a "0" in the I:0/0 data box.

4.  The instruction was looking for a "1" but found a "0", the instruction is evaluated as FALSE.  THIS IS IMPORTANT!  The instruction was false, the PLC does NOT stop scanning the rung and go to the next rung.  This is a common misconception that causes programmers not to fully understand how PLC scans work.  Whether the instruction is true or false, it executes the instruction to it's right passing to it either a TRUE or FALSE.

5 and 6.  The OTE instruction can do one of two things depending on whether it is passed a True or False value.

TRUE - If the conditions up to the instruction are true, then it will write a "1" in the O:0/0 data box.

FALSE - If the conditions up to the instruction are false, then it will write a "0" in the O:0/0 data box.  This key concept is missed by programmers.  As we learned in the RsLogix 500 - Downloading a program to a PLC which had a blank program, the absence of an instruction writing to an output does not make it OFF, something must write to it to turn it off.

The instructions leading up to our OTE were false, it writes a "0" to the O:0/0 data box.  If it has a "0" already in it then it still writes a "0" into the data box.  While this may seem like a trivial matter, it is important that you realize the step is taken no matter what so you realize when data is written which can affect the final outcome of an output's state.

7.  This is the end of the rung, the processor now moves to the far left of the next rung.

8.  The XIO instruction has different meanings associated with it, but the most basic and reliable meaning is the "0" in the I:0/0 data box.  Depending on what you have been taught previously, you may be thinking "Wait, I have a normally open contact connected to this input, how can I use a normally closed instruction?".  See our RsLogix 500 - Rants about XIC and XIO meaning normally open and normally closed to help clear this up.  The absolute best definition for an XIO is the "0" in the I:0/0 data box.

9.  The PLC looks in the I:0/0 data box and sees there is a "0" in the I:0/0 data box.

10.  The instruction was looking for a "0" and found a "0", the instruction is evaluated as TRUE.

11 and 12.  The instructions leading up to our OTE were true, it writes a "1" to the O:0/1 data box.

13.  This is the end of the rung, the processor now moves to the far left of the next rung.

14.  The last rung of the routine has an END instruction.  This was where you created the program.  It signals the PLC to proceed to update it's output instructions.

15.  The PLC updates it's outputs based off of the output data table.  If there is a "0" in an output data box then it turns the output OFF, if there is a "1" in an output data box then it turns the output ON.  THIS IS IMPORTANT!  No outputs have been turned ON or OFF in the program cycle before this point.

16.  There is an overhead step where the PLC does various housekeeping steps such as servicing communication ports including RsLogix 500. Don't worry about the details of this step for now.  After the overhead step is done, it returns to step 1.  The 16 steps above are done in a matter of milliseconds then it repeats the process.

Once the scan is done, our PLC now looks like this.

xic-xio-program-scan-explanation-details-button-not-pressed.png

Now let's press Button 1.  We already know what happens, but let's pause time for a second and walk through it.  In the following image Button 1 has been pressed but that same instance time stops.  Your PLC will look like the following image.  Below the image, we will walk through the steps of this PLC scan.

xic-xio-program-scan-explanation-details-button-pressed-but-not-scanned.png

 

1.  The PLC updates its input data table values based off of the physical states of the inputs.  Since Button 1 is pressed and the indicator for input "0" in the PLC screen is illuminated, it puts a "1" in the I:0/0 box.

2.  The PLC begins executing the ladder logic with the very left instruction of rung 0. Is the "1" in the I:0/0 data box?

3.  The PLC looks in the I:0/0 data box and sees there is a "1" in the I:0/0 data box.

4.  The instruction was looking for a "1" and found a "1", the instruction is evaluated as TRUE.

5 and 6.  The OTE instruction is passed a TRUE so it goes and writes a "1" into the O:0/0 data box.

7.  This is the end of the rung, the processor now moves to the far left of the next rung.

8.  The XIO instruction tells the PLC look to see if there is a "0" in the I:0/0 data box.

9.  The PLC looks in the I:0/0 data box and sees there is a "1" in the I:0/0 data box.

10.  The instruction was looking for a "0" and found a "1", the instruction is evaluated as FALSE.

11 and 12.  The instructions leading up to our OTE were false, it goes and writes a 0 to the O:0/1 data box.

13.  This is the end of the rung, the processor now moves to the far left of the next rung.

14.  The last rung of the routine has an END instruction.  It signals the PLC to proceed to update it's output instructions.

15.  The PLC updates it's outputs based off of the output data table.  If there is a "0" in an output data box then it turns the output OFF, if there is a "1" in an output data box then it turns the output ON.  THIS IS IMPORTANT!  The moment before this step, O:0/0's data box had a "1" in it but the output was off and O:0/1's data box had a "0" in it but the output was on.  Nothing happens to the physical outputs until this step.

16.  The PLC does it's overhead then returns to step 1.

Once the scan is done, our PLC now looks like this.

xic-xio-program-scan-explanation-details-button-pressed-and-scanned.png

Now let's release Button 1 and walk through the steps.  Hopefully at this point it will be repetition but make sure you thoroughly understand these principles before moving on to the next lesson.  Whether you are dealing with our 2 rung program or a 1000 rung program, the concepts are the same.  In the following image Button 1 has been released but that same instance time stops.  Your PLC will look like the following image.  Below the image we will walk through the steps of the PLC scan.

xic-xio-program-scan-explanation-details-button-released-but-not-scanned.png

1.  The PLC updates its input data table values based off of the physical states of the inputs.  Since Button 1 is not pressed and the indicator for input "0" in the PLC screen is not illuminated, it puts a "0" in the I:0/0 box.

2.  The PLC begins executing the ladder logic with the very left instruction of rung 0. Is there a "1" in the I:0/0 data box?

3.  The PLC looks in the I:0/0 data box and sees there is a "0" in the I:0/0 data box.

4.  The instruction was looking for a "1" and found a "0", the instruction is evaluated as FALSE.

5 and 6.  The OTE instruction is passed a FALSE so it goes and writes a 0 into the O:0/0 data box.

7.  This is the end of the rung, the processor now moves to the far left of the next rung.

8.  The XIO instruction tells the PLC look to see if there is a "0" in the I:0/0 data box.

9.  The PLC looks in the I:0/0 data box and sees there is a "0" in the I:0/0 data box.

10.  The instruction was looking for a "0" and found a "0", the instruction is evaluated as TRUE.

11 and 12.  The instructions leading up to our OTE were true, it goes and writes a "1" to the O:0/1 data box.

13.  This is the end of the rung, the processor now moves to the far left of the next rung.

14.  The last rung of the routine has an END instruction.  It signals the PLC to proceed to update it's output instructions.

15.  The PLC updates it's outputs based off of the output data table.  If there is a "0" in an output data box then it turns the output OFF, if there is a "1" in an output data box then it turns the output ON.  

16.  The PLC does it's overhead then returns to step 1.

Once the scan is done, our PLC now looks like this.

xic-xio-program-scan-explanation-details-button-not-pressed.png

Conclusion

That was a tremendous amount to take in.  Each of these lessons build on each other so make sure you understand the concepts above.  If necessary print it out and study on the steps the PLC follows to execute this simple program.  Once you feel comfortable with this lesson, continue to the RsLogix 500 - Electrical Contacts - Normally Open and Normally Closed Contacts lesson where we will take a "break" from programming and talk about normally open and normally closed contacts.

Information