Title: Working with STEP 7300 V5'1
1Working with STEP 7-300 V5.1
2What you will learn?
- Contact switches and Logic gates
3Basic LAD instruction
What is LAD?
- graphic programming language
- syntax of the instruction is similar to circuit
diagram
- consists of elements and boxes which are connect
graphically to form networks
4Configuration and Element of LAD
Elements and boxes can be classify as following
group
- individual element no need address or
parameters as this is a Logic Gate
- individual element need to enter address as
this is a Contact or Switch
- individual element need to enter address and
value as this is an Output
5- individual box with line indicating inputs and
outputs
- fill in the input parameters
- S7 place the output information for you
- EN/ENO function principles
- EN not activated ENO not activated
- EN activated ENO also activated if the
box function executed (comparison done) without
error
- EN activated ENO not activated if the
box function executed (comparison done) with
error
6Memory area and their functions
1 8 16 32
Global Variables (for all programs)
(Flag words)
For Analogue use only
7Global Variables (for all programs)
Local Variables (only for a particular program)
Counter and Data Block are only meant for High-
end PLC programming
8Bit logic instructions
Normally open contact
- If the instruction used is series, its combines
the result of its signal state check according to
the AND - truth table
- If the instruction used is parallel, its
combines the result of its signal state check
according to the OR - truth table
9Normally close contact
- If the instruction used is series, its combines
the result of its signal state check according to
the AND - truth table
- If the instruction used is parallel, its
combines the result of its signal state check
according to the OR - truth table
Switching between open closed contact is not
possible. Need to delete and re-insert!
10Output coil
- If the power can flow across the circuit to
reach the coil, the power energized the coil
(green line)
- If the power cannot flow across the entire
circuit to reach the coil, the power cannot
energized the coil
11Midline output (especially as an indicator)
- Intermediate assigning element that store the
last Result of Logic Operation (RLO) status
- Function as normal contact, cannot be located at
the end of network or end of an open branch
- M40.0 is energized when input M10.0 and M10.1
are ON. As such, M40 is the RLO of M10.0 and M10.1
- M40.1 is energized when either midline coil
M40.0, input M10.2 or M10.3 is Off
- M40.2 and M30.0 are energized when M40.1 is not
energized
12Invert power flow (Logic NOT)
13Set coil
- Only execute when the RLO 1, these instruction
sets the specified address to 1
- If RLO 0 the instruction has no effect on the
specified address. The address remains unchanged
14Reset coil
- Only execute when the RLO 1, these instruction
resets the specified address to 0
- If RLO 0 the instruction has no effect on the
specified address. The address remains unchanged
15Using Functions in Bit Instruction
Set counter value
- To place a preset value into the counter you
specified (max. count is 999)
- The transition is executed only if the RLO has a
positive edge detection
16Using Functions in Bit Instruction
Up counter coil
- Increments the value of the specified counter by
one if RLO has a positive edge and the value of
the - counter less than 999 (if above 999, use
Register)
- If the counter has value 999, the value of the
counter does not change even RLO has a positive
edge
17Using Functions in Bit Instruction
Down counter coil
- Decrements the value of the specified counter by
one if RLO has a positive edge and the value of
the - counter more than 0
- If the counter has value 0, the value of the
counter does not change even RLO has a positive
edge
18Using Functions in Bit Instruction
Pulse timer coil
- Produce a signal state of 1 after positive edge
of RLO detected as long as the timer is running
- Produce a signal state of 0 after the timer
expire or the RLO change to 0 before timer expire
(As according to the preset time or the input,
whichever shorter)
19Using Functions in Bit Instruction
Extended pulse timer coil (TP)
- Produce a signal state of 1 after positive edge
of RLO detected as long as the timer is running
- Produce a signal state of 0 after the timer
expire without regard the negative edge of the RLO
(As according to the preset time only)
20Using Functions in Bit Instruction
On delay timer coil (Timer ON)
- Produce a signal state of 1 after positive edge
of RLO and a specified time elapsed without error
and - RLO is still 1
- Produce a signal state of 0 if RLO change to 0
while the timer is running, the timer will stop
21Using Functions in Bit Instruction
Retentive on delay timer coil
- Produce a signal state of 1 after positive edge
of RLO and a specified time elapsed without error
even - if the RLO change to 0 before the time elapsed
- Produce a signal state of 0 only when you reset
the timer (external input to reset)
22Using Functions in Bit Instruction
Off delay timer coil (Timer OFF)
- Produce a signal state of 0 after negative edge
of RLO and a specified time elapsed without error
and - RLO is still 0
- Produce a signal state of 1 if RLO change to 1
while the timer is running, the timer will stop
23Using Functions in Bit Instruction
Positive RLO edge detection (similar to counter
but count above 999)
- recognized a change status of RLO from 0 to 1,
the last state of the RLO will store in one
address
24Using Functions in Bit Instruction
Negative RLO edge detection (similar to positive
RLO edge detection but used on NPN sensor)
- recognized a change status of RLO from 1 to 0,
the last state of the RLO will store in one
address
25Using Functions in Bit Instruction
Address Positive edge detection (similar to AND
gate)
- recognized a change status of address1 (exp a
sensor) from 0 to 1, the last state of the
address1 will store in address2
In this case, I0.3 and M0.0 is combined as one
26Using Functions in Bit Instruction
Address negative edge detection (similar to NAND
gate)
- recognized a change status of address1 from 1
to 0, the last state of the address1 will store
in - address2
27Using Functions in Block Instruction
Set Reset flip-flop
- Signal state is 1 if 1 at the S input and 0 at
the R input
- Signal state is 0 if 0 at the S input and 1 at
the R input
- Signal state is 0 if 1 at the S input and 1 at
the R input (therefore R is the Master)
28Using Functions in Block Instruction
Reset Set flip-flop
- Signal state is 0 if 1 at the R input and 0 at
the S input
- Signal state is 1 if 0 at the R input and 1 at
the S input
- Signal state is 1 if 1 at the S input and 1 at
the R input (therefore S is the Master)
29Timer Functions in Block Instruction
- Method used to preload a value to a timer
- Where w time base (time interval or resolution)
- Where xyz time value in BCD format (up to max.
999)
- S5TaH_bbM_ccS_ddMS (exp 2hr42m36s
S5T2H42M36S)
- Where a hours, bb minutes, cc seconds, d
milliseconds
- Time base selected automatically, the value is
rounded to the next lower number - with that time base (exp 42m36s to
43m)
- This is the preferred method used
30Using Functions in Bit Instruction
- Bit 12 13 of the timer word contain the time
base in binary code.
31Using Functions in Bit Instruction
Choosing the right timer
32Using Functions in Block Instruction
33Using Functions in Block Instruction
34Using Functions in Block Instruction
35Counter Function in Block Instruction
- Input S 1, set the counter with a preset value
- Input R 1, reset the counter with value 0
- Input CU change from 0 to 1 and the value of the
counter less than 999, the counter value - increase by one
- Input CD change from 0 to 1 and the value of
the counter more than 0, the counter value - decrease by one
- Output Q 1, if counter value more than 0
36Counter Function in Block Instruction
example
37Counter Function in Block Instruction
- Input S 1, set the counter with a preset value
- Input R 1, reset the counter with value 0
- Input CU change from 0 to 1 and the value of the
counter less than 999, the counter value - increase by one
- Output Q 1, if counter value more than 0
38Counter Function in Block Instruction
- Input S 1, set the counter with a preset value
- Input R 1, reset the counter with value 0
- Input CU change from 0 to 1 and the value of the
counter less than 999, the counter value - decrease by one
- Output Q 1, if counter value more than 0