Getting Started MrManh

download Getting Started MrManh

of 43

Transcript of Getting Started MrManh

  • 8/2/2019 Getting Started MrManh

    1/43

    ASIAN INSTITUTE OF TECHNOLOGYINDUSTRIAL SYSTEMS ENGINEERING

    MECHATRONICS AND AUTOMATION LABORATORY

    HOANG HUNG MANH

  • 8/2/2019 Getting Started MrManh

    2/43

    AUTOMATION TECHNOLOGYHAND ON LABORATORY SESSIONS

    SECTION APROGRAMMABLE LOGIC CONTROLLERS

    Mr. Hoang Hung Manh, M.EngSenior Laboratory SupervisorMechatronics and Automation Laboratory

    Email: [email protected]: + 66 2 524 5695Fax: + 66 2 524 5697

    Industrial Systems Engineering ProgramSchool of Advanced Technologies

    ASIAN INSTITUTE OF TECHNOLOGYBANGKOK - THAILAND

  • 8/2/2019 Getting Started MrManh

    3/43

    LIST OF ABBREVIATIONS

    Abbreviations Meanings

    AI : Analog InputAO : Analog OutputAPI : Application Program Interface.ASCII : American Standard Code for Information

    Interchange.ASIC : Application Specific Integrated Circuit, it is a Very

    Large Scale Integrated circuit, custom-designedto perform one or more particular functions.Advantages include fewer discrete components,lower power consumption and increased

    reliability.CAD : Computer Aided Design.CAM : Computer Aided Manufacturing.CIM : Computer Integrated Manufacturing.CNC : Computer Numerical Controlled.CP : Communication ProcessorCU : Count UpDAC : Digital to Analog Converter.DB : Data Block.DI : Digital Input

    DLL : Dynamic Link Library.DNC : Direct Numerical Control.DO : Digital OutputDPR : Dual-Port RAM.DRAM : Dynamic Random Access Memory.DSP : Digital Signal Processor.EIA : Electronic Industries Association (US based).EISA : Extended Industry Standard Architecture, a 32-

    bit adaptation of the 8/16-bit buses originallydeveloped by IBM and now standard in almost allPCs that use Intels 80X86 chips.

    FB : Function Block.FC : Function.GUI : Graphical User Interface, it describes the screen

    display that first greets a user and with which theuser interacts during the computer session. AGUI makes use of Windows, Icons, Menus andPointers-so-called WIMP systems, such asMicrosoft Windows, X-Windows.

    HC : Hardware ConfigurationI : Digital InputI/RF : Infeed Regenerative Feedback.IB : Input ByteIEC : International Electrotechnical Commission, this

  • 8/2/2019 Getting Started MrManh

    4/43

    is the international standards and conformityassessment body for all fields ofelectrotechnology.

    IEEE : Institute of Electrical and Electronic Engineers, aUS publishing and standards organization.

    IGBT : Insulated-gate Bipolar Transistor.IM : Interface Module.IPC : Industrial PC, IPCs are used in factory floors and

    are made at the quality that they can resist toheat, corrosion, humidity, vibration, noise, powersurges, cold and dust.

    ISA : International Standard Architecture, The 8/16-bit bus architecture originally developed by IBMand now standard in almost all PCs that useIntels 8086 and 80X86 chips.

    ISO : International Standard Organization.IW : Input WordLAN : Local Area Network.LED : Light Emitting Diode.M : Flag Internal Memory of PLCMAP : Manufacturing Automation Protocol, an ISO

    protocol stack that is defined as a functionalprofile. Originally developed by General Motorsfor use in factory floor manufacturingenvironments. It is based around the IEEE 802.4Token Bus LAN technology.

    MB : Flag ByteMCP : Machine Control Panel.MCU : Machine Control Unit.MMC : Man-Machine Communication. It is a PC in

    Sinumerik systems from Siemens, e.g. MMC102,MMC100. The operator communicates with theNCU through the software installed in MMC.

    MMI : Man - Machine Interface.MPI : Multi-Point Interface.MW : Flag WordNC : Numerical Control.OB : Organization Block.OEM : Original Equipment Manufacturer: the maker of

    equipment marketed by another vendor, usuallyunder the name of the reseller. The OEM maymake only certain components or completedevices, which can then be configured withsoftware and/or hardware by the reseller.

    OP : Operator Panel.OPI : Operator Panel Interface.PB : Program Block

    PCI : Peripheral Component Interconnect. It offersadvantages over the ISA bus: It is a processor-

  • 8/2/2019 Getting Started MrManh

    5/43

    independent bus specification, which allowsperipheral boards on the bus to access systemmemory directly without using the CPU. Using32/64 bit addresses at a 133 MHz clock speed,the bandwidth can be 80-90 MB/sec.

    PCMCIA : Personal Computer Memory Card InternationalAssociation

    PCS7 : Process Control System 7, package that consistsof many modules to cover PLC programming,interface creation, communication, network, etc.

    PG : Programming Device (E.g.: PG720, PG740 etc. areprogramming devices from Siemens).

    PID : Proportional-Integral-Derivative.PLC : Programmable Logical Control.POSIX : Portable Operating System Interface.PROFIBUS : PROcess FIeld BUS, it is Siemens's evolution of

    the ET 100 and ET 200 remote propriety bus. Itis a DIN standard and is in the hands of twoorganizations, PNO (Profibus ParentOrganization, Europe) and PTO (Profibus TradeOrganization, North America).

    PROFIBUS DP : PROFIBUS Decentralized Peripheral, it supportsthree masters, which operate with field nodes asmasters-to-slaves.

    PROFIBUS FMS : PROFIBUS Fieldbus Message Specification, it is ahigher-level bus intended to operate with PCs,

    PLCs and higher-level nodes.PROFIBUS PA : PROFIBUS Process Automation, it is an

    intrinsically safe (IS) bus which has essentiallythe same protocol as DP but the electricalspecifications are modified to satisfy the lowvoltage and current requirements of IS.

    PWM : Pulse Width Modulated.Q : OutputR274 D : EIA motion language standard (G-code).R422 : EIA serial interface, which allows high-speed data

    transmission between the computer and theperipherals over long distances, under high noiseconditions. The main difference between RS422and RS485 is that while RS422 is strictly forpoint-to-point communications, RS485 can beused for multidrop systems.

    RAM : Random Access Memory.RISC : Reduced Instruction Set Computer.ROM : Read Only Memory.RS232C : EIA serial interface standard for digital signals,

    short distance (15m) and low speed 20000

    bits/sec.RS485 : EIA serial interface standard for digital signals,

  • 8/2/2019 Getting Started MrManh

    6/43

    long distance (1200m) and high speed 100,000Bits/sec.

    SDB : System Data Block.SERCOS : SErial Real-time COmmunications System, it is a

    controller-to-digital drive interface specification

    (IEC1491) designed for high-speed serialcommunication of standardized closed-loop datain real time over a noise immune, fiber-opticcable. The transmission speed is 4Mbits/sec.

    SFB : System Function Block.SFC : System Function.SM : Signal Module.TCP/IP : Transmission Control Protocol/Internet Protocol.WINCC : Window Control Center, a human machine

    interface package from Siemens AG.

  • 8/2/2019 Getting Started MrManh

    7/43

    1.Introduction To Our Laboratory Sessions1.1Facility

    PLC systems and software packages, which are used during labsessions, arefrom Siemens AG. Siemens is one of the leading vendors of industrialautomation equipment in all over the world and its systems now are usedvery much in every industry and with many applications.

    1.1.1Software Packages

    Software package used to create the PLC program is SIMATIC Manager V5.3.PLC Simulation V5.3 is the CPU simulator for the above package. If you arethe integration engineer, PLC SIM is very useful and very important. PLCSIM allows you to do the project code without real systems.

    1.1.2PLC Systems

    You will be familiar with the real system after you have some understandingsabout the subject and could make some simple projects. The followingpicture shows you how a PLC system could be integrated to facilitate the labsessions.

    OFF

    ON

    DISwitc

    hes

    DOSock

    ets

    andLE

    Ds

    24VDCSwitchforDI

    220VAC

    PowerS.

    CPU

    DImodule

    DOmoduleON

    MP

    Rack

    Figure 1. Simulator

    1.1.3PLC System Configuration Examples

    Followings are some examples of PLC systems.

  • 8/2/2019 Getting Started MrManh

    8/43

    STATION 1

    Module Module Type Product Number

    Power 24VDC 2A

    CPU CPU315-2DP 315-2AF00-0AB0

    DI SM321 DI16x24VDC 321-1BH00-0AB0DO SM322 DO16x24VDC/0.5A 322-1BH00-0AB0

    STATION 2

    Module Module Type Product Number

    Power 24VDC 2A

    CPU CPU315-2DP V1.10 315-2AF03-0AB0

    DI SM321 DI32x24VDC 321-1BL00-0AA0

    DO SM322 DO32x24VDC/0.5A 322-1BL00-0AA0

    STATION 3

    Module Module Type Product Number

    CPU CPU314 314-2AE04-0AB0

    DI SM321 DI16x24VDC 321-1BH01-0AA0

    DO SM322 DO16x24VDC/0.5A 322-1BH01-0AA0

    *Module Type Numbers are appeared on the right-top corners of modules

    *Product Numbers are appeared on the left-bottom corners of modules*CPU: Central Processing Unit

    *DI: Digital Input*DO: Digital Output

    Table 1. System Configuration

    1.1.4Programmers and Communication Interface

    Programming devices are used to program PLC and to download to CPU.These devices, which have integrated interfaces with PLC, supplied bySiemens are called PG (standing for Programmer). E.g. PG 720, PG 740 etc.

    A standard PC could be used as a programming device if it meats thefollowing demand:

    - PC should have communication interfaces with PLC. These could beachieved by using PC/MPI adapters or Communication Interface Cards(CP), e.g. CP5611 etc. If PC/MPI adapter is used: one end of a PC/MPIadapter will be plugged into COM ports of the PC. If CP is used thenCP is inserted into main board of the PC. A serial cable is needed forconnecting to the CP port and the MPI port of PLC CPU.

    - SIMATIC MANAGER package could be installed in PCs runningWIN98/NT/2000/XP.

    - Necessary parameters should be correctly set. Those include portname, transmission rate etc.

  • 8/2/2019 Getting Started MrManh

    9/43

    Example of Communication Interfaces

    PC withSIMATIC

    MANAGERInstalled MPI

    interface

    on CPU

    COM1/COM2 of PC

    PC/MPIAdapter

    PC withSIMATICMANAGER

    InstalledMPIinterface

    on CPU

    Serial Cable

    CP5412

    Figure 2. Communication Interface

    1.1.5Other Equipment

    - N/A1.1.6Procedure to Access the Lab

    - Please read the lab regulations and strictly follow it.Power on the System

    All the PGs are connected to the ISE LAN. Users need to follow steps below touse PGs:

    - Turn on the PC- When you see the prompt then press Ctl+Alt+Del- To log in ISE LAN: following the procedure given by the network

    administrator.- To login locallyUser name: plcuserPassword: plcuserDomain: Name of the PC (e.g. MCT05, etc.)

  • 8/2/2019 Getting Started MrManh

    10/43

    If you are using the real PLC then you will turn on the main power of PLCsystem (which is the red switch). Other switch at Power Module is alsoneeded to be on. This is not applicable if you use the PLC SIM.

    Power off the system

    - Close all the software- Turn off properly the PC set (including the monitor)- If you use the real system then Turn off the switch on PLC Power

    Supply Module then turn off the main switch of the PLC system

    Printing Service

    - N/A

    1.2Lab Assignments and Report Submission

    Lab Assignments will consist of exercises and a final project. Reports ofexercises are individual whilst reports of projects could be submittedindividually or in groups. The requirement could be changed without notice.

    Contribution to the grade: Exercises 80% and project 20%

    1.3Software Borrow

    Each group may borrow the student version (valid for one year only) softwarefrom the labsupervisor. They should be returned in a good condition withlicense.

  • 8/2/2019 Getting Started MrManh

    11/43

    2.First Project

    Upon the completion of this session, students

    must:

    - Understand the denotation way of input,output, and flags

    - Understand and be able to recognize themodules.

    - Be able to use the tool for hardwareconfiguration (module configuration andparameter assignment)

    - Be able to use the tool to structure andgenerate a PLC program.

    - Be able to use the tool for testing and basictrouble shooting.

    - Understand symbols and be able to createthe symbol table.

  • 8/2/2019 Getting Started MrManh

    12/43

    2.1SIMATIC Manager Package and SIMATIC CPU-3002.1.1Creation of a New Project

    Figure 3. SIMATIC

    Manger Icon

    After left mousebutton double-clicking on the STEP7 icon, you can seethe opened window,next figure. Thiswindow is calledProject Window.

    Left mousebutton double click left on thisicon to run

    Simatic Manager

    Figure 4. Creationof a New Project

    When you doubleclick the left mousebutton on the first

    icon from the left,which is a whitepaper, a Newwindow will

    appeared. You caninput the projectname and also theplace your project issaved to. TheBrowse button isused to choose theplace. Remember thatunder Type shouldbe Project.

    Click on OK button,the New window willbe closed and you will

    have the next figure.

    Input the name ofyour project here.

    E.g. MyFirstProjectIndicate thelocation. If needed,

    use Browse

    Double click theleft mouse button

    to create newproject

  • 8/2/2019 Getting Started MrManh

    13/43

    Figure 5. Component View Window

    Your project name &its location areappeared on the title

    bar of this window.Just highlight theproject name and goto the next figure.

    Figure 6. SIMATICStation Insert

    Highlight the projectname and right-mouse button clickonce, then you go toInsert new object toinsert SIMATIC 300Station.

    Remember that thispackage is used for

    other hardware also.That is why you seemany other objects atpull-down window.

    After this step, you

    will see the nextfigure.

    Figure 7. SIMATICStation Insert(Cont.)

    SIMATIC 300(1),your station name,could be seen in theright partition. This isthe default name.You could modify it,as you like. Rightmouse button singleclick on the cross on.

    Left mouse button single click on thiscross to see components of this

    directory

  • 8/2/2019 Getting Started MrManh

    14/43

    2.1.2Hardware Configuration (HC)

    Figure 8. OpenHardwareConfigurationWindowIf you highlight theSIMATIC 300(1) onthe left partition thenyou can seeHardware icon onthe right. Left mousedouble click on theicon to open thehardwareconfigurationwindow, next figure.

    Figure 9. HardwareConfigurationWindowEach module ofSIMATIC has aproduct number. You

    have to declare themin the hardwareconfiguration. Look atmodules in Real.

    Note down theirproduct number,then you choosethem from thehardware catalog andarrange them as inReal Station.Firstly: rack, thenCPU, DI, and DO.Module productnumbers for yourstation are ready in

    1.1.2 PLC Systems

    Toggle this icon todisplay or hide theHardware Catalog

    window.

  • 8/2/2019 Getting Started MrManh

    15/43

    Figure 10. Rack/RailInsertYou start the HC by

    inserting the rack.Look at the hardwarecatalog and searchfor RACK-300 thenleft mouse buttondouble click to insertthe rack/rail intoyour HC. After that,you see the leftwindows with thename (0) UR. Thisindicates that youhave rack number 0.In the rack there areslots numbered from

    1 to 11. The rule isthat CPU will be

    inserted in slot 2, DIor DO start from slot4.

    Figure 11. CPUInsertNow you need toinsert the CPUmodule in slot 2.Firstly searching for

    the needed CPU andthen drag it into slot2.For Example: in thestation 2 I looked aton the bottom leftcorner of the CPUand read out 6ES7-315-2AF03-0AB0,furthermore I openthe small cover,which protect the MPIport, and read out

    V1.1. I am nowsearching for the CPUwith aboveinformation and drag

    it to slot 2.

    When you drag the CPU module into slot 2, you mayhave this small window. This asks if you want tonetwork your CPU to a Profibus. This happened if yourCPU is a CPU315-2DP model, which has a Profibusinterface integrated. In our case, we dont use it, soSubnet should show no networked. You then left

    mouse button single click to skip this small window.

    Remember that thespecs of CPU will beshown here if wehighlight its icon.The same is for

    other modules.

    Left mouse buttonsingle click on thecross to open the

    menu under it.

  • 8/2/2019 Getting Started MrManh

    16/43

    Figure 12. DI ModuleInsertIn the Real Hardware atthe simulator, I see thatafter CPU module is the DImodule. The rule is that

    the Signal Module (SM),which is DI, DO, AI or AO,must be inserted into slot4 forward. For example:I am configuring for station2. I have the followinginformation.Module type:SM321 DI32xDC24V.

    Product number:6ES7 321-1BL00-0AA0.Firstly, I search formodules in regards to

    module type. Secondly, Iwill specify the neededmodule in regards to theproduct number.

    Figure 13. DO ModuleInsert

    In the Real Hardware at

    the simulator, I see thatafter DI module is theDO module.You just imitate the

    procedure and hints ininserting the DI module.The below information isapplied for the DOmodule in station 2:Module type:SM322 DO32xDC24VProduct number:6ES7 322-1BL00-0AA0

    We search for thismodule under SM-

    300/DO-300 and thendrag it to the slot 5. Thatis it! Lets look at thefinished hardware

    configuration in the next

    Module productnumber and specs

    are displayed here

  • 8/2/2019 Getting Started MrManh

    17/43

    Figure 14. FinishedHardware

    ConfigurationIf we look at the HCwindow, thenfollowings are some

    explains:Slot 2 CPU: MPI

    address is 2.Slot 4 DI: I address03 It means that wecan use digital inputaddresses from I0.0 I3.7. Recall that thismodule has 32inputs, which aredivided into 4 bitgroups: group 0 (orbyte 0), group 1 (or

    byte 1), group 2(orbyte 2) and group3(or byte3)Slot 4 DO: Q address47. It means that

    we can use byte 4, 5,6, and 7 or I4.0 I7.7.

    This is default MPI

    address. If many PLCare networked withMPI then this shouldbe changed so eachaddress is unique.

  • 8/2/2019 Getting Started MrManh

    18/43

    Figure 15. Modification Start Address ofDigital Output

    Recall from the lastfigure that the Q

    addresses are fromQ4.0 Q7.7. I do

    want to use the startaddress of Q0.0instead of Q4.0. Wecan change it.Remember that thismodification couldnot be done with CPU314 in station 4;therefore those usingthis station shoulduse the default startaddress of digitaloutput module ofQ4.0.DO start addressmodification:

    Right mouse buttonclick on the moduleand open the ObjectProperties. Then you

    should see aproperties windowappearing. You then

    uncheck the SystemSelection.Next step is to modifythe Start to 0, thenclick the OK button.You have modifiedthe start address ofDO module.

    You will now see inthe HC window thatthe Q address of DOmodule changed to

    03 and not 47 asbefore.

    Why dont you clickon the disk icon tosave and go to thenext figure?

    Left mouse button single click

    on this icon to save your HC.

  • 8/2/2019 Getting Started MrManh

    19/43

    2.1.3Turn On PLC SIM

    If you use the PLC SIM then you must invoke it to work. You will skip thispart when you work directly with the real system.

    Left-Mouse click on this icon

    to run the PLC SIM

    This window is PLC SIM window.Just imagine that it is a PLCsystem.

    This icon tells you that your PLCSIM is already on

    2.1.4Downloading Hardware Configuration

    Before downloading please remember to turn on the PLC SIM if you do notwork with the real system.

  • 8/2/2019 Getting Started MrManh

    20/43

    Figure 16. Download

    HardwareConfigurationSupposing there is acommunication

    interface between thePG and the PLC CPU:there is an adapter /interface card, cableand parameters setOK. You now justclick on the downloadicon to load the HC tothe PLC CPU. This

    needs to be donebecause the CPU willnot automaticallyknow modules

    inserted into thesystem. When itrequires for thedestination modulethen you click on OKbutton.

    Download icon:

    arrow pointsdown

    If communication iswrong then go tofigure 36:CommunicationDiagnostics

    Figure 17.Download HC (Cont.)If the communicationbetween the PC andPLC is through thenthe PG could list allthe destinationstations, you now are

    require to indicatethe destinationaddress. In our case,it is point-to-point

    connection; thereforeonly one MPI addressis shown. You justclick on OK button tocontinue the action.Then just interactwith the software to

    finish the download.During the download,PLC will be in STOPmode and yellow LEDon the PLC will be on.

  • 8/2/2019 Getting Started MrManh

    21/43

    2.1.5User Program Creation

    Figure 18. Editing

    BlocksIf you left mousebutton single click onthe cross of icons andthen high-light theBlocks directorythen you will see onthe left partition thatthis directory containSystem data andOB1. These blocksare automaticallycreated whenever youmake the hardwareconfiguration. Usercould edit only OB1

    and not System data.A PLC program mustcontain at least OB1.OB1 stands for

    Organization Blocknumber 1 and ismain block. We nowwant to make asimple PLC program

    for 02 inputs and 01output. We will useOB1 only. Left mousebutton double clickon OB1 to open it.When the editingwindow appears (ason the left), you pulldown View menuand check at LAD(ladder). This is

    because we want toedit the program

    using graphicalladder diagrammethod.Left mouse buttonsingle click on thehorizontal like inNetwork 1 to high light it.

  • 8/2/2019 Getting Started MrManh

    22/43

    Figure 19. EditingOperands

    In the menu bar,there are icons:

    -[ ]- Normal Open-[\]- Normal Close

    -( )- OutputWe drag them to theline in the Network1 and key inaddresses as in this

    figure.

    If you do not key inthe address there will

    be ??.?Symbol andyou cannot exit.

    Figure 20. CompleteOB1Supposing that youhave completed the

    operand edit. Nowyou can name thenetwork 1 Firstnetwork andcommend it, This isthe first example of

    AND function.Save OB1, thendownload to PLC.During the download,you may be givensome questions. Justread and click on OK.Normally, the CPUwill stop duringdownloading. Letsclose the editingwindow and go to thenext section.

    Left mouse buttonsingle click on this icon

  • 8/2/2019 Getting Started MrManh

    23/43

    2.1.6Online Monitoring

    Figure 21. OpenOnline Project

    When you come back

    the project window,as on the left, you willsee an icon online.Click the mouse on itand go to the nextfigure.

    Figure 22. OnlineProject Window

    The title bar of onlineproject window has

    blue color. Whenlooking at rightpartition of thiswindow you will see alot of blocksremember that whatyou have downloadedare System dataand OB1. Otherblocks are inside thePLC from the factory.Click on OB1 toopen this block and

    go to next.

    Figure 23. OnlineTesting Program

    Now we are at editingwindow and onlinestatus. The title barscolor is green. Youare also noticed byONLINE.Lets look at network1: in ladder diagram

    you see greencontinuous sectionline and black brokensection line. Greencolor means power.Power needs to g fromthe left to the outputon the right.Next step will tell youhow to test.

    Left mouse button singleclick on this icon to openonlineproject window

  • 8/2/2019 Getting Started MrManh

    24/43

    2.1.7On-line Testing Using PLC SIM

    Do you remember the PLC SIM mentioned when you downloaded thehardware configuration. Just use the mouse to resize the window so that itlooks convenient.

    Check in boxes.RUN-P : CPU at RUN mode and program could be downloaded.RUN : CPU at RUN mode and program could not bedownloaded.

    STOP: CPU at STOP mode and you cannot debug yourprogram.

    MRES: Reset the CPU

    For debugging then check at RUN-P. DC and RUN LEDsshould be green, SF and STOP should be in ground color. DPLED is not applicable here and is always in RED color. DC ispower LED and will normally in GREEN color.

    If SF (System Fault) LED is in RED color, then you haveeither to check the hardware configuration or your programcode.

    Lets look a little bit more detail about this. Imagine that this is like a CPU.Simulating means to invoke the input and to check if the response of theoutput is as expected. We are going to supply I0.0 and I0.1 with logic 1 andwe check the response of Q0.0.

    Lets look at the TRUE-TABLE for AND function. The expected value of Q0.0is shown depending on the combination of inputs. For AND function, Q0.0 isON when and only when both I0.0 and I0.1 are ON.

    I0.0 I0.1 Q0.0

    OFF OFF OFFOFF ON OFF

    ON OFF OFF

    ON ON ON

    The following figure with explanation will tell you how to give signal to inputsand check signal at output.

  • 8/2/2019 Getting Started MrManh

    25/43

    Click hereto display inputbyte.Check hereto invoke bit I0.0and I0.1

    Click hereto display output byte

    If both I0.0 and I0.1 are checked,do you see a check at Q0.0

    Try it

    Checking on the boxes of the simulator to give signals to input is the sameas you supply 24 VDC to the inputs and you observe the LED at output.

  • 8/2/2019 Getting Started MrManh

    26/43

    Figure 24. OnlineTesting Program

    (Cont.)

    The logic program wehave made is an AND

    function. Q0.0 is onewhen and only whenboth I0.0 and I0.1 areon. If you look at the

    simulator, you knowthat I0.0 and I0.1 areconnected to twoswitches. Once

    switches are turnedon, the respectiveinput will be on andpower can go thoughit. In the figures, if we

    turn on the switchI0.0 then power canpass it but since I0.1has not yet turnedon, the output Q0.0is still in OFF status.

    If both I0.0 and I0.1are turned on, powercan propagate fromthe left to the right

    and make the output

    Q0.0 on.

  • 8/2/2019 Getting Started MrManh

    27/43

    2.1.8Symbols and Their Use

    Figure 25. Open SymbolTable

    If someone looks at absolute

    addresses, e.g. I0.0, I0.1, orQ0.0, he/she may not haveany idea what they are. Youcan imagine that your

    program has hundreds of I/O,I am sure that you cannothandle with the absoluteaddresses.Left mouse button double

    click on the Symbol icon.

    Figure 26. Edit Symbol Table

    The symbol editor window nowis opened. You give each inputor output a meaningful nameand also its comment.Please, follow the left figureand edit. After you have donethen you need to save. Youclose this window and open

    OB1 (if it hasnt been opened)

    Figure 27. SymbolicRepresentation

    You are at editing window ofOB1. Make sure that there isa check at Symbolic

    Representation at DisplayWith under View menu. Youobserve that instead ofabsolute addresses as I0.0,

    I0.1, and Q0.0, the symbolsare used. At SymbolInformation, there areabsolute addresses and their

    comments.

  • 8/2/2019 Getting Started MrManh

    28/43

    Figure 28. STLRepresentation

    Recall that we haveedited the OB 1 in

    LAD (ladderdiagram), you nowcheck on STLunder View menuand you can see theprogram in STL.STL stands forStatement List. Thisprogramming typeuses text only;therefore it could

    represent any logicfunction. Writing in

    STL is similar aswriting a programin assembly

    languages.

    Figure 29. FBDrepresentation

    You can also viewyour program inFBD (Function

    Block Diagram).FBD is one of thetwo graphicalrepresentationprogrammingmethod, and theother is the ladderdiagram.

    You can minimizethis window to go tothe next section.

  • 8/2/2019 Getting Started MrManh

    29/43

    2.2Hardware Diagnostics and Monitoring

    Figure 30. Open HCOnline

    To diagnose the

    hardware you need toopen HC online.Returning back tofigure 21 and 22 toactive online projectwindow, if youhighlight theSIMATIC 300(1),then you hasHardware on theright partition. Left

    mouse button double

    click on it to openhardwareconfiguration online.

    Figure 31. OnlineCheck DI Module

    We start withchecking DI module.Highlight the module,right mouse singleclick to have the pull

    down window.You can activate the

    module informationto see if the module iswrong or not. Younow activateMonitor/Modify toopen monitor/modify

    window.

  • 8/2/2019 Getting Started MrManh

    30/43

    Figure 32. Monitor DIModule

    Put a check at Monitorand click on StatusValue. You can check

    the status of each digitalinput in the Statusvalue column.

    Turn on one by one-digital input switch inthe panel of thesimulator and observe

    the change in the statusfrom green color to graycolor or vice verse.

    If you have done it then

    close this window and goto the next.

    Figure 33. OnlineCheck DO Module

    Similar as for the digitalinput module. If you liketo check if the outputmodule is in goodcondition then activateModule Information.

    You activateMonitor/Modify to

    open themonitor/modify window

    as in the next section.

  • 8/2/2019 Getting Started MrManh

    31/43

    Figure 34. Modify/Monitor DO

    Modules

    This window allowsyou to send signal

    to the digitaloutputs of the PLC.If you like to makesome DO on then

    simply key in 1 inthe respective rowunder Modifyvalue column then

    put a check inModify.

    Please do it forevery DO and check

    if LEDs are turnedon or not.

    If you have donethen close thiswindow and go to

    the next section.

  • 8/2/2019 Getting Started MrManh

    32/43

    2.3Communication DiagnosticsFigure 35. Communicat

    ion Verify

    Remember that if we

    want to download aprogram to the PLC or toonline diagnose then the

    communication betweenthe PG and its partner,PLC is very important.Fast check: In the

    project window, click onthe i icon if goodcommunication thenthere are accessiblenodes.

    Click on this icon tofast check thecommunication

    between the PG andPLC

    Figure 36. Communication Wrong

    When thecommunication is wrongthen if you try todownload anything tothe PLC, the softwarewill notice you that itcannot set up connection

    to the PLC CPU as you

    see on the left figure.

    To solve this problem, goto the next section tocheck the interface at PG

    side.

  • 8/2/2019 Getting Started MrManh

    33/43

    Figure 37. OpenPC/PG Interface

    In the projectwindow, you pulldown the Options

    menu and thenactivate SetPG/PCinterface to open itswindow.

    If you dont want toopen the SetPG/PCwindow from the

    project window youcan have other way:From START of theWINNT, you openCONTROL PANEL

    and then PG/PCinterface.

    Click hereto set theinterface.

    Figure 38. InterfaceInstallation

    You should understand that thecommunication

    protocol between PGand PLC is MPIprotocol (Multi-PointInterface). Thisprotocol is fromSiemens, and it isavailable at PLC side.

    PC needs a hardwareinterface to talk tothe PLC. If we useadapter to convertfrom serial to MPIthen we install driverPC Adapter. If weuse aCommunication

    Processor Card, thenwe need to install thepropriety driver one.

  • 8/2/2019 Getting Started MrManh

    34/43

    2.4CPU Key Switch

    On the front cover of the CPU, there is a key switch. The key switch can be manually turnedto one of 4 position: MRES, STOP, RUN, and RUNP. Once the key is removed the position of

    the switch cannot be changed. This is to make sure that only right person (the personhaving the key) could change CPUs modes.

    RUN-P: the CPU is in RUN mode and you can download program to it. This is normally usedwhen you are testing your program.

    RUN: the CPU is in RUN mode but you cannot download program to it. This is normal modein industry.STOP: if the key switch is in this position, then CPU is in stop mode. Outputs are reset.MRES: this is used when you want to reset the memory of the CPU.The CPU could be reset by software but many people like to manually reset. Following is theprocedure how to reset the CPU by the key switch. You can test bearing that procedure.

    Figure 39. Reset CPU By Key Switch

    (Source: Siemens Manual)

  • 8/2/2019 Getting Started MrManh

    35/43

    2.5Menu and Others2.5.1File Menu

    Figure 40. FileMenu in Project

    Window

    You have made thefirst project andlearn other things.Lets go throughmenu bar and seetheir functions.In the File menuof the projectwindow, there areimportantfunctions: they are

    Archive andRetrieve. Other

    things are similaras any software

    from Microsoft.

    Figure 41. ProjectArchive

    To archive means tozip, when you wantto back up yourproject either infloppy disk or harddisk you will needto go here. Whenarchiving, yourproject will bezipped by PK ZIP.

    Obviously, you can

    go to the location ofyour project andrun any zip

    software to back upbut why you needto do that when youare supplied with

    this function.

  • 8/2/2019 Getting Started MrManh

    36/43

    Figure 42. ProjectAchieve (Cont.)

    Archiving will askyou to provide thelocation for the

    zipped file.

    If you have yourdisk then archive

    the project into it.

    Figure 43. ProjectRetrieve

    When you want tounzip your projectto the PC then youwill use thefunction ofretrieving.

    Please test this

    function.

  • 8/2/2019 Getting Started MrManh

    37/43

    2.5.2Edit Menu

    Figure 44. EditMenu in Project

    Window

    In the Edit menu,most of the thingsare similar as in

    other package.

    2.5.3Insert Menu

    Figure 45. InsertMenu in Project

    Window

    If you highlight theCPU 315-2DPthen pull down the

    Insert menu thenyou will have the

    left window.

  • 8/2/2019 Getting Started MrManh

    38/43

    2.5.4PLC Menu

    Figure 46. PLCMenu in Project

    Window

    In this menu, youcan online monitoryour program, forcevalues, diagnosehardware, checkmoduleinformation, checkoperating mode ofthe PLC, clear/resetthe memory of thePLC, set time for

    the PLC, and more.

    Lets look at someimportant

    functions.

    Monitor/Modify Variables

    This function helps you to force variables. It means that you can give valueto variables via this function.

    Left-mouse click to activate

    the modify window.

  • 8/2/2019 Getting Started MrManh

    39/43

    At the time being, you just need to remember that with the variable table youcan modify the value of variables.

    Figure 47. Operating Mode

    If you open theOperating Modethen you can seewhich status the

    PLC is at:In our example,please turn the keyswitch to RUN-Pposition and look atthe left window:

    Current OperatingMode: RUN meansthat the CPU is inRUN mode. Youcan stop it byclicking on the

    STOP button andsee what willhappen.

  • 8/2/2019 Getting Started MrManh

    40/43

    Figure 48. Operating Mode (Cont.)

    The CurrentOperating Modenow is STOP. If

    you want to restartthe PLC then clickon Warm Restart.Please look at the

    LEDs on the CPU.RUN: green colorSTOP: yellow colorERROR: red color

    Remember that theCPU has keyswitches:RESET: to reset

    STOP: stop modeRUN: run modeRUN-P: run modeand you candownload programs

    Figure 49. CPUInformation

    You can check theinformation of thePLC CPU byactivating theModule

    Information underthe PLC menu.In our example, theStatus saysModule available

    and OK

  • 8/2/2019 Getting Started MrManh

    41/43

    Figure 50. Clear/ResetCPU

    You may like to downloadyour program in a blankCPU; you then need to

    reset the CPU. You cannotonly reset the CPU fromthe key switch on the CPUbut also from the software.

    By activating theClear/Reset functionthen you are given a noticeand questions.

    When you reset the CPU,your program andhardware configuration inthe PLC will be lost. You

    need to download againboth the hardwareconfiguration and yourprogram.

    Figure 51. Supplementary

    This is just a tricky. If youare at the project window,right mouse button single

    button click will give amenu similar to what you

    get from PLC menu.

  • 8/2/2019 Getting Started MrManh

    42/43

    2.5.5Options Menu

    Figure 52. OptionsMenu in Project

    Window

    As you know before,you will open theSetPG/PC

    Interface fromhere. There aresome morefunctions here butthey have very lowpriority to be

    learned.

    2.5.6Help Menu

    Figure 53. HelpMenu in Project

    Window

    At any time, thehelp menu will helpyou find out theinformation you

    need.

  • 8/2/2019 Getting Started MrManh

    43/43

    2.6Documents and Manuals

    Figure 54. Whereto Find Manuals

    All the standardmanuals areavailable in the PCat your station.Please find it as

    indicated on the leftwindow.

    The next window

    shows you the listof available

    manuals.

    Figure 55. List ofManuals

    All the manualshere are in PDFformat and theAcrobat Reader isalready installed inthe PC. You shouldknow that theimportant manualsare already printedout and available inthe cabinet. You

    cannot bring themout of the labwithout permissionof the labsupervisor