Professional Documents
Culture Documents
S7300 Variables
S7300 Variables
Adriad CHOO
Siemens S7 introduction
08.03.2012
1/30
KUKTEM
Defining Symbols
Contact switches and Logic gates Flip-flops Timers Counters
Adriad CHOO
Siemens S7 introduction
08.03.2012
2/30
KUKTEM
Adriad CHOO
Siemens S7 introduction
08.03.2012
3/30
KUKTEM
Adriad CHOO
Siemens S7 introduction
08.03.2012
4/30
KUKTEM
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 EN activated ENO also activated if the box function executed (comparison done) without error ENO not activated if the box function executed (comparison done) with error
Adriad CHOO
Siemens S7 introduction
08.03.2012
5/30
KUKTEM
1 8 16 32
(Flag words)
Adriad CHOO
Siemens S7 introduction
08.03.2012
6/30
KUKTEM
Global Variables (for all programs)
Adriad CHOO
Siemens S7 introduction
08.03.2012
7/30
KUKTEM
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
Adriad CHOO
Siemens S7 introduction
08.03.2012
8/30
KUKTEM
Normally 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!
Adriad CHOO
Siemens S7 introduction 08.03.2012 9/30
KUKTEM
Output 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
M30.1 is energized when input M10.0 and M10.1 and M20.1 are ON M30.0 is energized when input M10.0 and M10.1 are ON
M30.1 is energized when input M20.0 is OFF and M20.1 is ON M30.0 is energized when input M20.0 is OFF
Adriad CHOO
Siemens S7 introduction
08.03.2012
10/30
KUKTEM
Midline 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
KUKTEM
Invert power flow (Logic NOT) Reverse the RLO status
M30.0 is energized when input M10.0 is off or M20.0 and M20.1 are OFF
Adriad CHOO
Siemens S7 introduction
08.03.2012
12/30
KUKTEM
Set 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
M30.0 energized when input M10.0 and M10.1 are On or M20.0 is OFF
If the RLO of the branch is 0, The signal state of the M30.0 remains unchanged
Adriad CHOO
Siemens S7 introduction
08.03.2012
13/30
KUKTEM
Reset 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
If the RLO of the branch is 0, The signal state of the M30.0 remains unchanged
M30.0 reset to 0 when input M10.0 and M10.1 are ON or M20.0 is OFF
Adriad CHOO
Siemens S7 introduction
08.03.2012
14/30
KUKTEM
If the positive edge of the RLO detected, the counter C1 is preset with a value 100
If there is no positive edge, the preset value of the counter remains unchanged
Adriad CHOO
Siemens S7 introduction
08.03.2012
15/30
KUKTEM
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
Adriad CHOO
Siemens S7 introduction
08.03.2012
16/30
KUKTEM
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
Adriad CHOO
Siemens S7 introduction
08.03.2012
17/30
KUKTEM
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)
Adriad CHOO
Siemens S7 introduction
08.03.2012
18/30
KUKTEM
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)
T1 is on after RLO detection and as long as the timer T1 is running without regard the negative edge of the RLO
KUKTEM
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
If the timeIf M10.1 change M10.1 still before M30.0 will switch to ON elapses RLO, from 1 to 0 start If positive edge in theand thethe timer T1ON the timer T1 expired, the timer will stop and M30.0 remain OFF
Adriad CHOO
Siemens S7 introduction
08.03.2012
20/30
KUKTEM
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)
Timer T1 start after positive edge of RLO, T1 will turn on after A specified time elapsed without regard negative edge of RLO
Adriad CHOO
Siemens S7 introduction
08.03.2012
21/30
KUKTEM
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
IfIf M10.1 remainback to a while the time is running, the turn will M10.1 change 1 to 0, specified timer If M10.1 change from0 after 1the timer start elapsed, T1 willtimer off stop
Adriad CHOO
Siemens S7 introduction
08.03.2012
22/30
KUKTEM
recognized a change status of RLO from 0 to 1, the last state of the RLO will store in one address
Adriad CHOO
Siemens S7 introduction
08.03.2012
23/30
KUKTEM
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
Adriad CHOO
Siemens S7 introduction
08.03.2012
24/30
KUKTEM
recognized a change status of address1 (exp: a sensor) from 0 to 1, the last state of the address1 will store in address2
Adriad CHOO
Siemens S7 introduction
08.03.2012
25/30
KUKTEM
recognized a change status of address1 from 1 to 0, the last state of the address1 will store in address2
Adriad CHOO
Siemens S7 introduction
08.03.2012
26/30
KUKTEM
Signal state and address 0 if 0 at the S input and 1 at the R input Signal state isand address and 1 if 1 at the S input and 0 at the R input Signal state 0 if both S isis R input are 1
Adriad CHOO
Siemens S7 introduction
08.03.2012
27/30
KUKTEM
Signal state and address are 01 if both the R input and 1 at the S input Signal state and address are if 1 at the and R input are the Signal state and address are 1 if 0 at S R input and 0 at 1 S input
Adriad CHOO
Siemens S7 introduction
08.03.2012
28/30
KUKTEM
ii.
S5T#aH_bbM_ccS_ddMS (exp: 2hr42m36s = S5T#2H42M36S) 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
Adriad CHOO
Siemens S7 introduction
08.03.2012
29/30
KUKTEM
Adriad CHOO
Siemens S7 introduction
08.03.2012
30/30
KUKTEM
Adriad CHOO
Siemens S7 introduction
08.03.2012
31/30
KUKTEM
Adriad CHOO
Siemens S7 introduction
08.03.2012
32/30
KUKTEM
Adriad CHOO
Siemens S7 introduction
08.03.2012
33/30
KUKTEM
Adriad CHOO
Siemens S7 introduction
08.03.2012
34/30
KUKTEM
- 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
Adriad CHOO
Siemens S7 introduction
08.03.2012
35/30
KUKTEM
Reset M10.2
Force M10.2 on will load PV to CV and CV_BCD Set M10.3 will reset CV and CV_BCD to 0 Set to 1 to decrease CV by one Set to 1 to increase CV by one
Reset M10.3 to 0
Adriad CHOO
Siemens S7 introduction
08.03.2012
36/30
KUKTEM
- 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
Adriad CHOO
Siemens S7 introduction
08.03.2012
37/30
KUKTEM
- 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
Adriad CHOO
Siemens S7 introduction
08.03.2012
38/30