program control instructions: using rslogix 500 software

24
Program Control Program Control Instructions: Instructions: Using RSLogix 500 Using RSLogix 500 Software Software

Upload: jane-quinn

Post on 28-Dec-2015

290 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: Program Control Instructions: Using RSLogix 500 Software

Program Control Program Control Instructions:Instructions:

Using RSLogix 500 SoftwareUsing RSLogix 500 Software

Page 2: Program Control Instructions: Using RSLogix 500 Software

Why these skills are Why these skills are important:important:

• Program control instructions allow Program control instructions allow you to change the order in which the you to change the order in which the processor scans a ladder program. processor scans a ladder program.

• These instructions are used to These instructions are used to minimize scan time, create a more minimize scan time, create a more efficient program, and troubleshoot a efficient program, and troubleshoot a ladder logic program.ladder logic program.

Page 3: Program Control Instructions: Using RSLogix 500 Software

Program Control Program Control Instructions:Instructions:

• Input and output instructions that, Input and output instructions that, when used together, change how and when used together, change how and where an SLC 500 processor scans. where an SLC 500 processor scans.

• Program control instructions dictate Program control instructions dictate the sequence in which the program is the sequence in which the program is executed, thereby interrupting the executed, thereby interrupting the normal sequence of the processor normal sequence of the processor operating cycle.operating cycle.

Page 4: Program Control Instructions: Using RSLogix 500 Software

Processor Operating Cycle & Processor Operating Cycle & Program Control Instructions:Program Control Instructions:

• The following The following graphic provides a graphic provides a review of how the review of how the processor processor operating cycle, operating cycle, without program without program control control instructions, is instructions, is divided:divided:

Page 5: Program Control Instructions: Using RSLogix 500 Software

Common Program Control Common Program Control Instructions:Instructions:

•The following program control instructions The following program control instructions are commonly used:are commonly used:

Page 6: Program Control Instructions: Using RSLogix 500 Software

Jump to Label (JMP) & Label (LBL) Jump to Label (JMP) & Label (LBL) Instructions:Instructions:

• Jump to Label (JMP) InstructionsJump to Label (JMP) Instructions: An : An output instruction that directs the processor output instruction that directs the processor to skip rungs (forward or backward).to skip rungs (forward or backward).

• Label (LBL) InstructionLabel (LBL) Instruction: An input : An input instruction that is the target of JMP instruction that is the target of JMP instructions having the same label number.instructions having the same label number.

• JMP and LBL instructions are used in pairs to JMP and LBL instructions are used in pairs to skip portions (zones) of the ladder program, skip portions (zones) of the ladder program, which reduces scan time.which reduces scan time.

• ZoneZone: a section of ladder logic.: a section of ladder logic.

Page 7: Program Control Instructions: Using RSLogix 500 Software

The following graphic shows examples The following graphic shows examples of single and multiple JMP instructions:of single and multiple JMP instructions:

Page 8: Program Control Instructions: Using RSLogix 500 Software

When the JMP rung is true:When the JMP rung is true:

• The program skips from the rung The program skips from the rung containing the JMP instruction to the rung containing the JMP instruction to the rung containing the designated LBL containing the designated LBL instructions.instructions.

• The program continues executing.The program continues executing.

• The zone rungs between the JMP and LBL The zone rungs between the JMP and LBL instructions are not executed.instructions are not executed.

• The zone outputs remain in their last The zone outputs remain in their last state.state.

Page 9: Program Control Instructions: Using RSLogix 500 Software

When the JMP rung is false:When the JMP rung is false:

• The program does not execute the The program does not execute the JMP instruction.JMP instruction.

• The zone rungs will be executed.The zone rungs will be executed.

• The zone outputs function normally.The zone outputs function normally.

The condition of the JMP rung has no The condition of the JMP rung has no effect on rungs outside the zone.effect on rungs outside the zone.

Page 10: Program Control Instructions: Using RSLogix 500 Software

Jump to Subroutine (JSR), Subroutine (SBR), Jump to Subroutine (JSR), Subroutine (SBR), and Return from Subroutine (RET) and Return from Subroutine (RET) Instructions:Instructions:

• Subroutine: A program file that Subroutine: A program file that performs a specific task.performs a specific task.

• A subroutine will interrupt the A subroutine will interrupt the program scan based on the specified program scan based on the specified instruction. For SLC 500 processors, instruction. For SLC 500 processors, program files 3 to 255 are program files 3 to 255 are designated for subroutines.designated for subroutines.

Page 11: Program Control Instructions: Using RSLogix 500 Software

Subroutine are used in the following situations: Subroutine are used in the following situations: Loading a recipeLoading a recipePerforming a calculationPerforming a calculationCleaning a vatCleaning a vatPurging a systemPurging a systemEmptying a tankEmptying a tankPacking and sealing a cartonPacking and sealing a cartonThe following graphic represents subroutines in a processor The following graphic represents subroutines in a processor operating cycle:operating cycle:

Page 12: Program Control Instructions: Using RSLogix 500 Software

• Jump to Subroutine (JSR):Jump to Subroutine (JSR): An output An output instruction that directs the controller to instruction that directs the controller to jump to a targeted subroutine file.jump to a targeted subroutine file.

• Subroutine (SBR):Subroutine (SBR): An input instruction An input instruction that marks the beginning of a subroutine.that marks the beginning of a subroutine.

• Return (RET):Return (RET): An output instruction that An output instruction that marks the end of a subroutine execution marks the end of a subroutine execution or the end of the subroutine file.or the end of the subroutine file.

Page 13: Program Control Instructions: Using RSLogix 500 Software

•JSR and SBR instructions JSR and SBR instructions are used together to direct are used together to direct the processor to execute a the processor to execute a separate subroutine file separate subroutine file within the ladder logic within the ladder logic program. The RET program. The RET instruction causes the instruction causes the processor to resume processor to resume program execution in the program execution in the program file that called the program file that called the subroutine. Program subroutine. Program execution continues at the execution continues at the instruction following the JSR instruction following the JSR instruction where it exited instruction where it exited the program. The following the program. The following graphic shows the graphic shows the instructions used to instructions used to execute a subroutine file:execute a subroutine file:

Page 14: Program Control Instructions: Using RSLogix 500 Software

• Nested Subroutine File:Nested Subroutine File: A subroutine that A subroutine that directs program execution to another subroutine.directs program execution to another subroutine.

Page 15: Program Control Instructions: Using RSLogix 500 Software

Master Control Reset Instruction:Master Control Reset Instruction: An output instruction An output instruction that, when used in pairs, defines program zones where all that, when used in pairs, defines program zones where all non-retentive outputs may be disabled at the same time for non-retentive outputs may be disabled at the same time for the same length of time. the same length of time. Rungs within the MCR zone are still scanned, but scan time is Rungs within the MCR zone are still scanned, but scan time is reduced due to the false state of non-retentive outputs.reduced due to the false state of non-retentive outputs.The true and false states for MCR instructions are summarized The true and false states for MCR instructions are summarized in the following table:in the following table:

Page 16: Program Control Instructions: Using RSLogix 500 Software

Master Control Reset (MCR) Master Control Reset (MCR) Instruction:Instruction:

•Non-Retentive Non-Retentive Outputs and the Outputs and the MCR Instruction:MCR Instruction: Non-retentive Non-retentive outputs reset when outputs reset when rung conditions go rung conditions go false; retentive false; retentive outputs do not. outputs do not. MCR instructions MCR instructions turn off all non-turn off all non-retentive outputs in retentive outputs in a section of ladder a section of ladder logic. Examples of logic. Examples of non-retentive and non-retentive and retentive outputs retentive outputs are shown in the are shown in the following graphic:following graphic:

Page 17: Program Control Instructions: Using RSLogix 500 Software

Keep these points in mind when interpreting Keep these points in mind when interpreting MCR instructions:MCR instructions:

• The MCR instruction is not a substitute The MCR instruction is not a substitute for a hard-wired master control relay for a hard-wired master control relay that provides emergency stop that provides emergency stop capability.capability.

• TOF timers will activate when placed TOF timers will activate when placed inside of a false MCR zone.inside of a false MCR zone.

• If an unmatched MCR instruction exists If an unmatched MCR instruction exists in the project, the END instruction is in the project, the END instruction is used to mark the end of the MCR zone.used to mark the end of the MCR zone.

Page 18: Program Control Instructions: Using RSLogix 500 Software

Temporary End (TND) Temporary End (TND) Instruction:Instruction:• An output instruction that controls the An output instruction that controls the

scanning operation of a processor.scanning operation of a processor.• When the logic preceding this output When the logic preceding this output

instruction is true, the TND:instruction is true, the TND:• Stops the processor from scanning the rest of the Stops the processor from scanning the rest of the

program file.program file.• Updates the I/OUpdates the I/O• Resumes scanning at rung 0 of the main program.Resumes scanning at rung 0 of the main program. If this instruction rung is false, the If this instruction rung is false, the

processor continues the scan until the next processor continues the scan until the next TND instruction or the END statement.TND instruction or the END statement.

Page 19: Program Control Instructions: Using RSLogix 500 Software

Suspend (SUS) Instruction:Suspend (SUS) Instruction:

• An output instruction that causes a An output instruction that causes a processor to enter the suspend idle processor to enter the suspend idle mode and stores a suspend ID number mode and stores a suspend ID number in word 7 (S:7) of the status file. All in word 7 (S:7) of the status file. All outputs are de-energized.outputs are de-energized.

• This instruction can be used to identify This instruction can be used to identify specific conditions for program specific conditions for program debugging and system troubleshooting.debugging and system troubleshooting.

Page 20: Program Control Instructions: Using RSLogix 500 Software

Interpreting Jump to Label (JMP) and Interpreting Jump to Label (JMP) and Label (LBL) Instructions:Label (LBL) Instructions:

Page 21: Program Control Instructions: Using RSLogix 500 Software

Interpreting Jump to Subroutine (JSR), Interpreting Jump to Subroutine (JSR), Subroutine (SBR), and Return from Subroutine (SBR), and Return from Subroutine (RET) Instructions:Subroutine (RET) Instructions:

• The following graphic shows an example of JSR, SBR, and RET The following graphic shows an example of JSR, SBR, and RET instructions.instructions.

Page 22: Program Control Instructions: Using RSLogix 500 Software

Interpreting Master Control Reset (MCR) Interpreting Master Control Reset (MCR) Instructions:Instructions:

The following graphic The following graphic shows an example of an shows an example of an MCR instruction. MCR instruction. When pushbuttons 5, 8, When pushbuttons 5, 8, and 9 are pressed, coils 6 and 9 are pressed, coils 6 and 8 are energized and and 8 are energized and the T4:6 timer begins the T4:6 timer begins timing.timing.When the pushbutton 7 is When the pushbutton 7 is pressed, the MCR zone is pressed, the MCR zone is activated.activated.Coil 8 is de-energized, and Coil 8 is de-energized, and the TON timer stops the TON timer stops timing.timing.Coil 6 remains on because Coil 6 remains on because it is a retentive output.it is a retentive output.The T4:7 timer begins The T4:7 timer begins timing.timing.

Page 23: Program Control Instructions: Using RSLogix 500 Software

Interpreting Temporary End (TND) Interpreting Temporary End (TND) Instructions:Instructions:

• The following graphic shows an example of a TND The following graphic shows an example of a TND instruction. In the example, note the following:instruction. In the example, note the following:

• When switch 10 is closed, the TND instruction stops When switch 10 is closed, the TND instruction stops the processor from scanning the rest of the program the processor from scanning the rest of the program file.file.

• I/O is updated, and the processor resumes scanning I/O is updated, and the processor resumes scanning at rung 0 of the main program file.at rung 0 of the main program file.

Page 24: Program Control Instructions: Using RSLogix 500 Software

Interpreting Suspend (SUS) Interpreting Suspend (SUS) Instructions:Instructions:

• The following graphic shows The following graphic shows an example of an SUS an example of an SUS instruction. In the example, instruction. In the example, note the following:note the following:

• When switch 15 is closed When switch 15 is closed and the value in N7:0 is and the value in N7:0 is greater than or equal to 75, greater than or equal to 75, the processor is placed in the processor is placed in the Suspend Idle Mode.the Suspend Idle Mode.

• The suspend ID is placed in The suspend ID is placed in word S:7 of the processor word S:7 of the processor status file.status file.

• All outputs are de-All outputs are de-energized.energized.