Wednesday, September 9, 2015

Learning PLC Programming With Simatic S7-PLCSim




Simatic S7-PLCSim is a software for simulates PLC program in in Simatic S7. Simatic S7-PLCSim can run PLC Program without Real Simatic S7-300/S7-400 Station. With Simatic S7-PLCSim can help user for Simulates and Check the Simatic S7 Program before downloaded into S7-300/S7-400 Station.
Simulation systems provide effective support with the development of programs and the following actual application. In the automation environment, a simulated test environment including PLC and process reduces startup times and thus costs, for example. Early discovery of programming errors and optimization of program sections enable the optimized and error free use of the programs in the actual system. If a program is modified, it can be tested prior to loading it onto the plant control system

SIMATIC S7-PLCSIM simulates a controller for functional testing of user blocks and programs for S7-300 and S7-400 on the programming device/PC. Online access and test functions of the programming tools can be carried out in exactly the same manner as with a real controller. This allows the entire program test to be carried out on-site in the development office. Thefacility to simulate the communication via MPI, PROFIBUS DP and TCP/IP is new and ensures a high degree of flexibility in the simulation. S7-PLCSIM executes the user program just like a real controller (special functions such as F technology only conditionally). During program execution, different process values can be monitored and changed via a simple user interface (e.g. switching inputs/outputs on or off).

Step 1: Setup PG/PC Interface

Open Simatic Manager in Start menu > Simatic Manager

If the simatic manager not show in favorite list in start menu open All Program, search Simatic folder and select Simatic Manager. Or in Desktop, double click on Simatic Manager ICON
Simatic Manager


If you don’t have previous Simatic S7 Program/Project, Simatic manager will appear will blank screen.

In this season we will create simple program, and simulates with Simatic S7-PLCSim. First we must setup the PG/PC Interface. PG/PC Interface is to configure the communication between the PG/PC and the PLC. During installation, youare displayed a dialog for assigning parameters to the PG/PC interface. You can also open thisdialog box after installation, by calling the program"Setting PG/PC Interface" in the STEP 7program group. This enables you to modify the interface parameters at a later time, independentlyof the installation. In select Option then “set PG/PC Interface”


PG/PC Interface window will appear, in highlighted box show the list of interface between PG/PC and Simatic S7 300/400 Station. In the list interface with first name PLCSim is used for Simatic S7-PLCSim. In this case we use PLCSim (MPI) for communication between PG/PC and Simatic S7 300/400 Station.

Step 2: Create New Project

For create new Program choose “New” in File menu or you can use short cut CTRL+N, New Project Windowwill appear.

In box Name fill the name of project and choose the storage location for project to store. And then click OK.

In highlighted box show the project object, the project object represents the entirety of all the data and programs in an automation solution, and islocated at the top of an object hierarchy.

Step 3: Add Station Object

Right click on Project Object and select the station. In the sample we use Simatic 300 Station

below Project Object will appear Station Object (SIMATIC 300/400), A Station Object represents a S7 hardware configuration with one or moreprogrammable modules.

Step 4: Hardware Configuration

Double click in Hardware and will appear HW-Config Window, in this window you can choose the Processor, Module DI, Module DO, Module AI, Module AO as needed for the project.

In right side is library for CPU, DI, DO, AI, AO, etc. first we must add the rack, expand folder rack-300 and drag the rack symbol into main window.

After addingrack, in main window will appear a rack window and we can put the Processor, Input output Module, power supply, etc. in this case we just create a simple program for DOL and simulating with PLCSim. Just select CPU-312 and Digital Input and Digital Output. Save and Compile.

Step 5: Network Configuration

The network configuration should be set, for setting the network configuration click NetPro Icon.

The CPU 312 only have one port MPI for communication, that’s why we choose PLCSim (MPI) for PG/PC Interface. Click and Drag port MPI in CPU 312 into MPI network, this represent the Station connected with PG/PC use MPI Interface.

Step 6: Create the Program


Below station Object, there is Programmable Module object. A programmable module represents the parameter assignment data of a programmable module(CPUxxx, FMxxx, CPxxx). The systemdata of modules with no retentive memory (for example,CP441) are loaded via the CPU of thestation. For this reason, no "system data" object is assignedto such modules and they are not displayed in the project hierarchy. In one Station Object we can create more than one Programmable module object.
Below Programmable Module Object, there is Program Object. A (S7/M7) program folder contains software for S7/M7 CPU modules or software for non-CPUmodules (for example, programmable CP or FM modules).
Below Program Object there is Source File Folder Object. A source file folder contains source programs in text format.
Below Source File Folder Object, there is Block Folder Object. A block folder of an offline view can contain: logic blocks (OB, FB, FC, SFB, and SFC), data blocks(DB), user-defined data types(UDT) and variable tables. The system data object representssystem data blocks.The block folder of an online view contains the executable programs parts that have beendownloaded to the programmable controller.

Select Block Folder Object, there is OB1, OB1 is default Organization Block this is main program for S7 Programmable Logic Control. Double click in OB1 and will appear Dialog Box for Properties-Organization Block 1. You can select the language for programming in Ladder, STL, and FBD. Then click OK.

Figure below show the Program Block window, in this window we can create the program. In left side is library for Bit Logic, FB, SFC, etc. and right side is main window for create program. Create program for DOL.

We can add Symbol, symbol can make Input or Output easier to recognize. In edit menu select Symbol, and will appear Symbol editor, we can add symbol for each Input and Output. Click apply for applying symbol and then OK.


After finish create program, in Program Block window click save for save the changes.

Step 7: Start Simatic S7-PLCSim

In simatic manager select Simatic S7-PLCSim icon for Run Simulation.

Window Simatic S7-PLCSim will appear,

We can make a change for input and output variable during a simulation.IB 0 represent for Input address 0.0 to 0.7 and QB 0 represent the output with address 0.0 to 0.7. The default condition for all bit is De-energize/False and we check the box it will energize the bit.

Step 8: Download the Program into PLC

Select the OB1, then right click and download Program into PLC.

Step 9: Running the simulation

After program downloaded into PLC, in S7-PLCSim window move CPU state from Stop to run, and The Program Simulates, try to make change in Input variable and see the change for Output.

In Program, input 0.1 used for energize output 0.1. Click on the box IB 0 address 1, and see the change on QB 0 address 1.

Input 0.2 used for de-energize output 0.1, uncheck the box IB 0 address 1 and then check the box IB 0 address 2 and see the change in QB 0 address 1.

Step 10: Monitoring in Program Block Window

The simulation can monitored in Program Block window, this feature can help user for check the program. Click Monitor mode icon in Program Block window.

Program Block window will be Online, and we can monitoring the program

And see the different between input 0.1 energize and input 0.2 energize

Figure above show when Input 0.1 energize, and output 0.1 energize

Figure above show when Input 0.2 energize, and output 0.1 de-energize

Download project file click here
Video Demonstration: https://www.youtube.com/watch?v=rue3Q2tPIVQ


Labels:

Newer Post Older Post Home

You may also like these ebook:

Get Free PLC eBook directly sent to your email,
and email subscription to program-plc.blogspot.com




We hate SPAM. Your information is never sold or shared with anyone.

Your Email Will Be 100% Secured !

Your email is stored safely on Google FeedBurner