Professional Documents
Culture Documents
Ejemplos de Promancion PLC PDF
Ejemplos de Promancion PLC PDF
Rungs 19 to 24 will Restore all T4 Preset values from the N files back to the Timers.
Rungs 13 to 18 and 19 to 24 work in the save way. The addressing in the move
command is in reverse.
The Following Truth Table will explain the Indirect Addressing in the Move
Command.
1 T4:1.PRE N7:1
2 T4:2.PRE N7:2
3 T4:3.PRE N7:3
4 T4:4.PRE N7:4
5 T4:5.PRE N7:5
6 T4:6.PRE N7:6
7 T4:7.PRE N7:7
8 T4:8.PRE N7:8
9 T4:9.PRE N7:9
10 T4:10.PRE N7:10
11 T4:11.PRE N7:11
12 T4:12.PRE N7:12
Lets change the Oscillator OSR Circuit. Delete rung 15 and change rung 14 to look like
this. Rung 14 will now Oscillator itself on and off. We just cut this program down to 5
rungs for the save fuction.
Now combined the Count rung and the Move rung to look like this and to cut one more
rung out of the program.
You can use the same idea to restore from or save to a different set of N files by using
Indexed Indirect Addressing. The processor first resolves the indirect portion of the
address and then adds the offset from the Index Register S:24 to come up with the final
address.
This program will not work for T4:0 due to the fact that C5:0 is set to zero then will
count up to 1 before the Move Command saves any values into the N file. If you have
more than 12 Timers to save just set the preset value of C5:0 to the number of timers
you want to save.
Traffic Light with 10 Second Delay Green on South Green
Light
T4:0 - Red for North Light O:3/5 - Red North Light
T4:4 - 10 second Delay, Green South Light O:3/0 - Green E/W Lights
T4:5, T4:6 - Blink Green North Light O:3/1 - Amber E/W Lights
Use T4:0/TT and T4:4/TT to trun O:3/8 on O:3/3 - Red E/W Lights
branch T4:0/TT and T4:4/TT in one rung O:3/8 - Red South Light (not shown)
Traffic Light with Sequencers
Looking at the Offset for Position 1 you can see that N/S Red Light is On and E/W Green
Light is On
The E-Stop should be hard wired and the PLC should just monitor it to stop the
program (to put machine in Manual Mode). When the E-Stop is pressed all air should
be dumped to any cylinders for safety. Input I:1/1 is a pushbutton. When the E-Stop is
not pressed and the Start button is pressed and Switch (I:1/2) is in Auto Mode then the
machine will Latch in Auto Mode. When the Auto/Man Switch is in Man Mode the
machine will cycle one time when the Start Button is pressed. If switched to Manual
Mode in mid cycle the machine should finish the cycle then stop.
Jump Instruction (JMP)
The symbol for the jump command is illustrated above. The JMP command is placed on
the right side of the rung. When the rung is activated by a TRUE logical operator or input
control, the JMP instruction skips over the rungs between the JMP instruction and the rung
with the LBL instruction. Execution continues after the rung with LBL. (Note: The JMP
instruction work forward only.) For multiple jumps, a counter can be used to create a do loop
in ladder logic.
If the rung is false the JMP instruction is skipped, causing no jump in the programming
ladder logic. The LBL rung in the ladder logic is treated as any other line in the program and
is scanned each time the program cycles.
The JMP and LBL parameter are assigned to the JMP and LBL commands by positioning the
cursor on the instruction and then double clicking the left mouse button. This opens a text
box so that the parameter value can be entered, or highlight the instruction by selecting it and
typing in the value.
Example Problem 1
Write a ladder logic program that will skip several rungs in a program when I:1/1 becomes
TRUE.
In this example the JMP instruction is activated when I:1/1 is true. This causes the program
to skip to the Q2:0 LBL instruction. The program will continue from the LBL command.
Example Problem 2
Write a ladder logic program that will jump up to T4:2 timer when the output O:2/0 becomes
TRUE.
In this example the JMP command is used to jump to a timer that may be used several times
in the program.
OSR
The following is an example of how the OSR command works with a 2 rung Ladder Logix.
This 2 rung program is an One-Shot.
The One-Shot Output B3:3/2 will be triggered for the duration of one program scan
and then goes off. The one-shot can be triggered from a momentary signal, or one that
comes on and stays on for some time. The above 2 rung program is how the [OSR]
command works.
OSR-1
The following is an example of the OSR command and its Logix.
Example OSR-1
Input Scan=I:1/0 is On
OSR-2
In the next Example rungs 1 and 2 are reversed from the above example.
Example OSR-2
Input Scan = I:1/0 is On
I:1/0 is a pushbutton switch or an Input from an Panel View (Touch Screen). You can
use this Logix as a Auto/Man button, using one input to put a machine in Automatic or
Manual with just one Pushbutton. Output B3:3/3 will Flip/Flop on with one push of the
button then off with the next push of the button.
Put an contact in the above example to monitor an E-Stop to put the machine in
Manual on shutdown/stopping the machine. Input I:1/1 will trun off Output B3:3/3 and
put the machine in Manual.
Label Instruction (LBL)
[Introduction Page] [Command Index] [Programming References]
The symbol for the LBL instruction is illustrated above. The LBL instruction is placed
on the left side of the rung. The LBL command indentifies the jump (JMP) target for the
command. The LBL instruction is not located under the JMP command in the programming
logic, then a FAULT will occur. The label command becomes TRUE when activated by a
jump command and any other logic inbedded on the rung is evaluated.
The JMP and LBL parameter are assigned to the JMP and LBL commands by positioning the
cursor on the instruction and then double clicking the left mouse button. This opens a text
box so that the parameter value can be entered, or highlight the instruction by selecting it and
then typing in the value.
NOTE: Rungs with the LBL commands will be scanned by the processor even if the JMP
instruction was not executed. Do not place the LBL inside a Master control reset (MCR)
zone. Any instructions located between the LBL instruction and the End MCR instruction
will always be evaluate as if the MCR instruction were TRUE without regard to its actual
state.
Example Problem 1
Write a ladder logic program that will skip several rungs in a program when I:1/1 becomes
TRUE.
In this example the JMP instruction is activated when I:1/1 is true. This causes the program
to skip to the address Q2:0 LBL instruction. The program will continue from the LBL
command.
Example Problem 2
Write a ladder logic program that will jump up to T4:2 timer when the output O:2/0 becomes
TRUE.
In this example the JMP command is used to jump to a timer that may be used several times
in the program.
FIFO Load / FIFO Unload
The following is an example of the FIFO Load and FIFO Unload command.
All Inputs are Pushbuttons so you need to use the OSR Command. Without the OSR
command N7:12 would be filled up with one push of the Push Button. When inputs
I:1/0, I:1/1, I:1/2 are true FIFO Load will load the corresponding number into N7:12.
When I:2/1 is true FIFO Unload will unload the first number loaded into N7:11.
After it is unloaded from N7:12 into N7:11, then the Equal commands will compare
what is in N7:11 to 12, 13, and 14. When Source A (N7:11) equals Source B (12,13 or
14) then the corresponding Output (O:3/1, O:3/2 or O:3/3) will be true. When Input
I:1/3 is true, the Move command will move Source 0 into N7:11, Resetting N7:11. Then
I:2/1 can then unload the value from N7:12 into N7:11 again.
By adding Rung 8 to the above program you can add a Memory Clear Push Button.
The FIFO Unload will unload all of the values in N7:12 into N7:10, clearing N7:12 and
the Move command will clear N7:11 by moving Source A (0 - zero) into N7:11.
Jump to Subroutine Instruction (JSR)
[Introduction Page] [Command Index] [Programming References]
The jump to subroutine (JSR), subroutine (SBR), and return (RET) instructions are used to
direct the controller to execute a separate subroutine file within the ladder program and
return to the instruction following the JSR instruction.
The symbol for the Jump to Subroutine command is illustrated above. The JSR command
is placed on the right side of the rung. When the rung is TRUE, the JSR instruction
jumps to a designated subroutine file stored in the program files folder.
To enter a parameter into the JSR command, highlight the command and type a number between (3
- 255).
Use the following prodedure to create a subroutine folder:
1. In the left split screen, left mouse click the program files folder to highlight.
2. Right mouse click on the file folder to open menu box.
3. Select new.
4. Type the same number that was entered into the JMP command.
5. Optional, name the subroutine folder in space provided.
Use the tab on the bottom of the ladder logic program to switch between the main logic program
and the SUBROUTINE program.
The subroutine folder should have a subroutine(SBR) instruction and a return from
subroutine (RET) instruction. The SBR instruction must be the first instruction on the first
rung in the program files that contain the subroutine. The RET marks the end of the
subroutine execution or the end of the subroutine file. It causes the controller to return to the
program where the JSR command instruction was placed and resumes' execution of that
program.
After the JSR is activated the scanning order for the PLC ladder includes: The PLC jumps to
the labeled subroutine, scans the subroutine program, and returns to the main program to
continue to scan the main program rungs after the JSR command. If a timer is located within
the SBR, the JSR must have a latched input in order for the timer to reach the preset time.
Once the timer has completed the timer cycle, it unlatches the contacts holding the JSR
command in the TRUE state by using a rung in the subroutine file.
Example Problem
Use a subroutine command to count the number of parts passing through a system. When the
counter reaches ten, have the controller turn off an output.
In this example the subroutine contains a counter. Each time the JSR inputs are activated in
the main program by either the I:1/0 or I:1/5 the counter counts up by one in the subroutine
program. This example allows parts to be countered at two different places. When the
counter reaches ten O:2/9 is disabled.
Jump/Label Example
I:1/0 will Lacth B3:3/0 on. If B3:3/0 is on then, the Jump command will jump over
rungs 3 and 4 to rung 5 with the Label command. As long as B3:3/0 is latched on rungs
3 and 4 will never be scaned. I:1/1 will Unlacth B3:3/0 and let rungs 3 and 4 to be
scaned.
JSR/SBR/RET Example
Lad 2
In the JSR command the U:3 refers to Lad 3 (The Subroutine Ladder)
Lad 3
The RET command will return the scan to Lad 2 Rung 3 after the Subroutine Ladder is
done.
Program Condition Example
Valves will be open based on the Conditions set in the Program Logix.
The RET command is used in conjunction with the jump to subroutine (JSR), and
subroutine (SBR) commands. The instructions are used to direct the controller to execute a
separate subroutine file within the ladder logic program and return to the previous program at
the rung following the JSR instruction.
The symbol for the Return to Subroutine command is illustrated above. The RET command
or commands can be placed within or at the end of the subroutine file. The RET
instruction may be conditional if the rung conditional logic is true. This way the controller
omits the balance of a subroutine only if the rung conditional logic is true.
Use the tab on the bottom of the ladder logic program to flip between the main logic program
to any subroutine programs.
After the JSR is activated the scanning order for the PLC ladder includes: The PLC jumps to
the labeled subroutine, scans the subroutine program, and returns to the program where the
JSR was placed in order to continue to scan that program. The scanning continues from the
rung after the JSR command. If a timer is located within the SBR, the JSR must have a
latched input in order for the timer to reach the preset time. Once the timer has completed the
timer cycle, within this file unlatch the contacts switch within the subroutine.
Example Problem
Use a subroutine command to count the number of parts passing through a system. When the
counter reaches ten, have the controller turn off an output.
In this example the subroutine contains a counter. Each time the JSR inputs are activated in
the main program by either the I:1/0 or I:1/5 the counter counts up by one in the subroutine
program. This example allows parts to be countered at two different places. When the
counter reaches ten O:2/9 is disabled.
Bit Shift Left (BSL) Example for a Production Line
I:1/0 shifts the bit to the left as the line moves. I:1/1 detects an item on the line and puts
a bit (1) in file #B3:0. As the bit shifts Spray 1 will spray and then Spray 2 will spray.
Counter C5:1 counts as the item enters and C5:2 counts as the item exits.
Data file B3 showns a bit in B3:0/1 (Spray 1) and B3:0/4 (Spray 2).
Subroutine Instruction (SBR)
[Introduction Page] [Command Index] [Programming References]
The symbol for the subroutine command is illustrated above. The SBR command is
placed on the first rung of the subroutine file. A subroutine is used to store recurring sections
of program logic that must be executed from several points within the main program logic.
When the rung is TRUE, the JSR instruction jumps to a designated subroutine file stored in
the program files folder.
To enter a parameter into the JSR command, highlight the command and type a number between (3
- 255).
Use the following prodedure to create a subroutine folder:
1. In the left split screen, left mouse click the program files folder to highlight.
2. Right mouse click on the file folder to open menu box.
3. Select new.
4. Type the same number that was entered into the JMP command.
5. Optional, name the subroutine folder in space provided.
Use the tab on the bottom of the ladder logic program to switch between the main logic program
and the SUBROUTINE program.
The subroutine folder should have a subroutine(SBR) instruction and a return from
subroutine (RET) instruction. The SBR instruction must be the first instruction on the first
rung in the program files that contain the subroutine. The RET marks the end of the
subroutine execution or the end of the subroutine file. It causes the controller to return to the
program where the JSR command instruction was placed and resumes' execution of that
program.
Use the tab on the bottom of the ladder logic program to flip between the main logic program
to the subroutine program.
After the JSR is activated the scanning order for the PLC ladder includes: The PLC jumps to
the labeled subroutine, scans the subroutine program, and returns to the main program to
continue to scan the main program rungs after the JSR command. If a timer is located within
the SBR, the JSR must have a latched input in order for the timer to reach the preset time.
Once the timer has completed the timer cycle, it unlatches the contacts holding the JSR
command in the TRUE state by using a rung in the subroutine file.
Example Problem
Use a subroutine command to count the number of parts passing through a system. When the
counter reaches ten, have the controller turn off an output.
In this example the subroutine contains a counter. Each time the JSR inputs are activated in
the main program by either the I:1/0 or I:1/5 the counter counts up by one in the subroutine
program. This example allows parts to be countered at two different places. When the
counter reaches ten O:2/9 is disabled.
Program Condition Example
Valves will be open based on the Conditions set in the Program Logix.
S2:4/7 is one of the Clock Cycle bits. You can same scan time by using this bit. In the
example above the N10:0 will be copied into N11:0 every 2.56 seconds.
S2:1/15 is the First Pass Bit. The rung is true only for the first scan after entering the
run mode. Upon the first scan Timer T4:0 and T4:1 will be set to default times in N12:0
and N13:0.
Temporary End Instruction (TND)
[Introduction Page] [Command Index] [Programming References]
The symbol for the temporary end command is illustrated above. The TND command is
placed on the right side of the rung. When the rung is activated, the TND instruction stops
the processor from scanning the rest of the program file. The TND instruction then updates
the I/O, and restarts scanninig at the beginning of the program. If the TND instruction is
false, the processor continues scanning until the next TND instruction or the END statement
is read.
NOTE: When using the TND instruction within a nested subroutine, the TND command will
terminate all of the nested subroutine.
Example Problem
Create a program with two TND instructions to debug portions of the program.
In the example, placing the TND's in the program allows the programmer to test a section of
the progam for any errors. By using external switches, a portion of the program ladder logic
is scanned at a time. The example shows the program ladder logic was split into three
sections using the TND command. When switch I:1/0 is active the program scans down to
that rung (0005) then jumps back to the beginning of the program and continues the scan. If
I:1/0 is de-activated and I:1/4 (rung 0009) is activated the program will scan down to this
rung and return to the beginning of the program. De-activating both TND's will allow the
program to continue to scan the third section of the program.
Master Control Reset Instruction (MCR)
[Introduction Page] [Command Index] [Programming References]
The symbol for the Master Control Reset command is illustrated above. The MCR command
is placed on the right side of the rung. This output instruction is used to set up areas or
"zones" of your ladder program where all non-retentive outputs may be disabled at the same
time for the same length of time. MRC's are used in pairs, one MCR is used to define the
start of the ladder area to be affected and one MCR to define the end of the area.
An input instruction is programmed on the rung of the first MCR to control rung logic
continuity. When the rung goes "false" all set outputs within that zone are scanned as false
i.e. all non-retentive outputs within the controlled zone are disabled. When the rung goes
"true" all rungs are scanned according to their normal rung conditions.
The Master Control Reset ID numbers, -32,768 to +32,767, are assigned to the MCR command by
positioning the cursor to the right of the Master Control Reset ID in the command and then double
clicking the left mouse button. This opens a text box so that the constant value for the source may
be typed.
The ending MCR instruction must be the only instruction on the rung.
WARNING!
Do not use conditional logic before an ending MCR instruction.
The MCR instruction is not a substitute for a hard-wired master control relay that provides
emergency stop capability.
MCR controlled areas must contain only two MCR instruction- one to define the start and
one to define the end.
When editing a rung that contains an MCR instruction, both the MCR start and MCR end
rungs must be edited at the same time.
If you start instructions such as timers or counters in an MCR zone, instruction operation
ceases when the zone is disabled. The TOF timer will activate when placed inside of a false
MCR zone.
Example Problem
In this example, when I:1/1 is TRUE the Master Control Reset command allows normal scan
with normal effects on the outputs. A false input to the first MCR command, disables any
outputs within the zone (O:2/1).
Suspend Instruction (SUS)
[Introduction Page] [Command Index] [Programming References]
The symbol for the Suspend command is illustrated above. The SUS command is placed
on the right side of the rung. When the SUS rung is TRUE, the instruction places the PLC in
suspend idle mode and de-energizes all outputs.
The suspend ID numbers, -32,768 to +32,767, are assigned to the SUS command by
positioning the cursor to the right of the Suspend ID in the command and then double
clicking the left mouse button. This opens a text box so that the constant value for a source
may be typed.
Example Problem
The symbol for the Immediate Input with Mask command is illustrated above. The IIM
command is placed on the right side of the rung. When the IIM rung is TRUE, the
program scan is interrupted, and data from a specified input slot is transferred through the
mask to an input data file. This data is available to the commands in the ladder, following the
IIM instruction.
The IIM operates on the inputs assigned to a particular word of a slot (16 bits maximum).
For the mask, a (1) in the bit position passes data from the source to the destination. A (0)
inhibits data bits from passing from the source to the destination.
Values and addresses are assigned to the IIM command by positioning the cursor to the right
of the slot, mask, and length location in the command and then double clicking the left
mouse button. This opens a text box so that the input or the constant values for the IIM
command may be typed. You can enter the constant in binary, decimal, or hexadecimal.
Slot: Specifies the input slot on the PLC and specific input word. Example I:1.0 means input of slot 1
word 0.
Mask: Specify a Hex constant or register address. OFFFh is a mask value that will allow all of the (1)
bits to pass through.
Length: This parameter is used to transfer more than one word per slot, only for the SLC 5/03 and
5/04 processors. For example, fixed and SLC 5/01 controllers can have up to 8 words associated with
the slot. The SLC 5/02, 5/30, 5/04, and 5/05 controllers can have up to 32 words associated with the
slot.
Example Problem
Write a ladder logic program that will update a specific input in the middle of a program.
The value for the mask will be 000Fh.
In this example the IIM instruction retrieves data from I:1.0 and passes it through the mask.
The mask permits only the four least significant bits to be moved to the input register I:1.0,
allowing the ladder programmer to only update sections of the inputs to be used throughout
the rest of the program.
The symbol for the Immediate Output with Mask command is illustrated above. The IOM
command is placed on the right side of the rung. When the IOM rung is TRUE, the
program scan is interrupted, and data from a specified output slot is transferred through the
mask to an output data file. This data is available to the commandsin the ladder, following
the IOM instruction.
The IOM operates on the outputs assigned to a particular word of a slot(16 bits maximum).
For the mask, a (1) in the bit position passes data from the source to the destination. A (0)
inhibits data bits from passing from the source to the destination.
Values and addresses are assigned to the IOM command by positioning the cursor to the
right of the slot, mask, and length location in the command and then double clicking the left
mouse button. This opens a text box so that the output or the constant values for the IOM
command may be typed. You can enter the constant in binary, decimal, or hexadecimal.
Slot: Specifies the output slots on the PLC and specific output word. Example O:1.0 means output of
slot 1 word 0.
Mask: Specify a Hex constant or register address. OFFFh is a mask value that will allow all of the (1)
bits to pass through.
Length: This parameter is used to transfer more than one word per slot, only for the SLC 5/03 and
5/04 processors. For example, fixed and SLC 5/01 controllers can have up to 8 words associated with
the slot. The SLC 5/02, 5/30, 5/04, and 5/05 controllers can have up to 32 words associated with the
slot.
Example Problem
Write a ladder logic program that will update a specific output in the middle of a program.
In this example the IOM instruction retrieves data from O:2.0 and passes it through the mask.
The mask permits only the four least significant bits to be moved to the ouput register O:2.0,
allowing the ladder programmer to only update sections of the output throughout the rest of
the program.
The Refresh (REF) instruction is used to update all the input and
output bits in the controller in the middle of a program.
The symbol for the refresh command is illustrated above. The REF command is placed
on the right side of the rung. The REF instructions stops scanning program , executes the I/O
scan to update the inputs and outputs when the logic controlling the REF command becomes
true. Then the scan resumes at the instruction following the REF command.
The Channel 0 and 1 is changed from NO to YES, by positioning the cursor to the right of
the Channel in the command and then double clicking the left mouse button. This opens a
text box so that you can select YES or NO. These communication ports are found on the
front of the CPU card of the PLC and may be configured for a specific purpose.
DF1 is channel 0
DH485 is channel 1
The REF instruction has no programming parameters when used with the 5/02 processor. With the
5/30, 5/04 and 5/05 processors, however, you can select a specific communication channel or both
channels for servicing.
NOTE: The REF command should only be placed in a program that has been thoroughly analyzed.
When the REF instruction is executing, watchdog and scan timers are reset. Do not place the REF
inside a non-terminating programming loop.
Example Problem
Use the refresh command to update the I/O in the middle of the program.
In this example the REF command updates the DF1 channel, when the input switch is
activated.