PLC Programming
GRESHA S. SAMARAKKODY
Step 7 – MICRO/WIN
This software makes programming of S7-200 easier.
• Basic instructions:
INPUTS will be defined as IX.X
OUTPUTS will be defines as QX.X
FLAGS will be defined as MX.X
Example :
I0.1 first module’s 1st input
Q0.1 first module’s 1st output
Step 1: How to open Step 7 – Micro/WIN
To open the software :
Step 7 Micro/WIN Start Window
Steps of Running Code on PLC
Open Step
Micro/WIN
Write a Simple
Code in Ladder
Network
Compile Your
Code
Download
Your Code to
PLC
Run PLC to
Perform Code
Timers
Table 1 : Timer Numbers and Resolutions
Timers
Table 2 : Operations of the Timer Instructions
Step 2: Writing a simple program
 Click on “Bit Logic” icon to open bit logic
commands
 Choose “Normally close contact”
Drag and drop the contact to network 1
 Write the M0.0 instead of the question marks (???)
over the contact. M0.0 is a flag contact
 Press the enter button to finish contact definition.
Setting up a timer
 Click on “timer” icon to see all timer commands
 Choose TON (on delay timer)
 Drag and drop the TON to network 1 next to M0.0
 Write the T33 instead of the question marks (???) over
the timer box
 Press enter the cursor will go to PT section
 Enter timer setting as : 100
 Press enter to finish setting up the timer
Step 3:
Turning the Output On (Network 2)
When the timer value for T33 is greater than or equal
to 40 (40 times 10 milliseconds or 0.4 seconds), the
contact provides power flow to turn on output Q0.0
of the S7-200.
Double click the compare icon to display the compare instructions.
Select the >=I instruction
 Hold down the left mouse button and drag the compare
instruction onto the second network
Click on the “???” above the contact and enter the address for the
timer value : T33
 Press the Return key to enter the timer number and to move the
focus to the other value to be compared with the timer value
 Enter the following value to be compared with the timer value : 40
 Press the return key to enter the value.
To enter the instruction for turning on
output Q0.0
 Double click the Bit Logic icon to display the bit logic
instructions and select the output coil
 Hold down the left mouse button and drag the coil
onto the second network
Click on the “???” above the coil and enter the
following address: Q0.0
Press the return key to enter the address for the coil
Step 4: Resetting the Timer
When the timer reaches the preset value (100) and
turns the timer bit on, the contact for T33 turns on.
Power flow from this contact turns on the M0.0
memory location. Because the timer is enabled by a
Normally Closed contact for M0.0, changing the
state of M0.0 from off (0) to on (1) resets the timer.
To enter the contact for the timer bit of T33
 Select the Normally Open contact from the bit logic
instructions
 Hold down the left mouse button and drag the contact
onto the third network
 Click on the “???” above the contact and enter the
address of the timer bit: 33
 Press the Return key to enter the address for the contact
To enter the coil for turning on M0.0:
 Select the output coil from the bit logic instructions
 Hold down the left mouse button and drag the
output coil onto the third network
 Double-click the “???” above the coil and enter the
following address: M0.0
 Press the Return key to enter the address for the coil
Save the project File Save As
Step 7 Micro/WIN Resetting the Timer
Network 3
Whole Example and Output Timing
Diagram
Step 5 : Downloading the Sample Program
to PLC
 Click the Download icon on the toolbar or select the
File > Download menu command to download the
program
 Click OK on opened window to download the
elements of the program to the S7-200
Upload and Download Button
Step 6 : Running the PLC
For STEP 7- Micro/WIN to place the S7-200 CPU in
RUN mode, the mode switch of the S7-200 must be
set to TERM or RUN. When you place the S7-200
executes the program:
Click the RUN icon on the toolbar select the PLC > RUN
menu command
 Click OK to change the operating mode of the S7-200
Run and Stop Buttons
Counters
Operations of the Counter Instructions
END

PLC Programming.pdf

  • 1.
  • 2.
    Step 7 –MICRO/WIN This software makes programming of S7-200 easier. • Basic instructions: INPUTS will be defined as IX.X OUTPUTS will be defines as QX.X FLAGS will be defined as MX.X Example : I0.1 first module’s 1st input Q0.1 first module’s 1st output
  • 3.
    Step 1: Howto open Step 7 – Micro/WIN To open the software :
  • 4.
    Step 7 Micro/WINStart Window
  • 5.
    Steps of RunningCode on PLC Open Step Micro/WIN Write a Simple Code in Ladder Network Compile Your Code Download Your Code to PLC Run PLC to Perform Code
  • 6.
    Timers Table 1 :Timer Numbers and Resolutions
  • 7.
    Timers Table 2 :Operations of the Timer Instructions
  • 8.
    Step 2: Writinga simple program  Click on “Bit Logic” icon to open bit logic commands  Choose “Normally close contact” Drag and drop the contact to network 1  Write the M0.0 instead of the question marks (???) over the contact. M0.0 is a flag contact  Press the enter button to finish contact definition.
  • 9.
    Setting up atimer  Click on “timer” icon to see all timer commands  Choose TON (on delay timer)  Drag and drop the TON to network 1 next to M0.0  Write the T33 instead of the question marks (???) over the timer box  Press enter the cursor will go to PT section  Enter timer setting as : 100  Press enter to finish setting up the timer
  • 11.
    Step 3: Turning theOutput On (Network 2) When the timer value for T33 is greater than or equal to 40 (40 times 10 milliseconds or 0.4 seconds), the contact provides power flow to turn on output Q0.0 of the S7-200.
  • 12.
    Double click thecompare icon to display the compare instructions. Select the >=I instruction  Hold down the left mouse button and drag the compare instruction onto the second network Click on the “???” above the contact and enter the address for the timer value : T33  Press the Return key to enter the timer number and to move the focus to the other value to be compared with the timer value  Enter the following value to be compared with the timer value : 40  Press the return key to enter the value.
  • 13.
    To enter theinstruction for turning on output Q0.0  Double click the Bit Logic icon to display the bit logic instructions and select the output coil  Hold down the left mouse button and drag the coil onto the second network Click on the “???” above the coil and enter the following address: Q0.0 Press the return key to enter the address for the coil
  • 15.
    Step 4: Resettingthe Timer When the timer reaches the preset value (100) and turns the timer bit on, the contact for T33 turns on. Power flow from this contact turns on the M0.0 memory location. Because the timer is enabled by a Normally Closed contact for M0.0, changing the state of M0.0 from off (0) to on (1) resets the timer.
  • 16.
    To enter thecontact for the timer bit of T33  Select the Normally Open contact from the bit logic instructions  Hold down the left mouse button and drag the contact onto the third network  Click on the “???” above the contact and enter the address of the timer bit: 33  Press the Return key to enter the address for the contact
  • 17.
    To enter thecoil for turning on M0.0:  Select the output coil from the bit logic instructions  Hold down the left mouse button and drag the output coil onto the third network  Double-click the “???” above the coil and enter the following address: M0.0  Press the Return key to enter the address for the coil Save the project File Save As
  • 18.
    Step 7 Micro/WINResetting the Timer Network 3
  • 19.
    Whole Example andOutput Timing Diagram
  • 20.
    Step 5 :Downloading the Sample Program to PLC  Click the Download icon on the toolbar or select the File > Download menu command to download the program  Click OK on opened window to download the elements of the program to the S7-200
  • 21.
  • 22.
    Step 6 :Running the PLC For STEP 7- Micro/WIN to place the S7-200 CPU in RUN mode, the mode switch of the S7-200 must be set to TERM or RUN. When you place the S7-200 executes the program: Click the RUN icon on the toolbar select the PLC > RUN menu command  Click OK to change the operating mode of the S7-200
  • 23.
    Run and StopButtons
  • 24.
  • 26.
    Operations of theCounter Instructions
  • 27.