How Do You Simulate Communication Between Two CPU Modules

3
Industry Online Support Product Support Entry type: FAQ, Entry ID: 38726591, Entry date: 08/23/2010 How do you simulate communication between two CPU modules? Rate (1) Instructions: As from S7PLCSIM V5.4 + SP3 you can use S7PLCSIM to simulate multiple CPU modules simultaneously in a STEP 7 project and establish communication between the CPU modules. The following communication blocks are supported for communication: SFB8 "USEND" SFB9 "URCV" SFB12 "BSEND" SFB13 "BRCV" SFB15 "PUT" SFB14 "GET" SFB19 "START" SFB 20 "STOP" SFB 22 "STATUS" SFB 23 "USTATUS" During communication, there might be time restrictions because S7PLCSIM does not support real time. Please also refer to the information in the S7PLCSIM readme file, section 7.3. If, when running a large number of Windows programs, you cannot start any more programs or you cannot open any more windows, then you must change the operating system property "desktop heap memory" of your PC. One remedy is described in Table 02 (#Marke_1). You cannot test a program of your STEP 7 project with a real CPU (PLC) at the same time as a program with S7PLCSIM. If you wish to simulate your CPUs with S7PLCSIM, you must first disconnect all connections to the real CPU. Proceed as described in Table 01 below to simulate multiple CPU modules simultaneously. No. Procedure: 1 Open S7PLCSIM in the SIMATIC Manager, either via the menu command "Options> Simulate Modules" or from the menu bar with the "Simulation on/off" icon. The dialog with the instance number "S7PLCSIM1" with the first simulated CPU opens. 2 In the "S7PLCSIM1" dialog, you select the configured interface parameterization from the dropdown list box for the PG/PC interface. The MPI interface is preset by default. Later, S7PLCSIM starts with the interface last used. However, depending on your hardware configuration, you can also set the "PROFIBUS", "TCP/IP" (via the IP address), "ISO" (via the MAC address) or "Local" (via the virtual backplane bus) interface. Note: You must not use the addresses more than once in the same subnetwork. If you load all your programs via the MPI interface, for example, then the different MPI addresses might look like this: Station 1: MPI address: 2 Station 2: MPI address: 3 etc. 3 In the SIMATIC Manager, mark the block folder of your first S7 station and load your blocks in S7PLCSIM1 via the menu command "PLC > Upload". 4 In the "CPU" subwindow in S7PLCSIM, change the operating mode from "STOP" to "RUNP". Via the "Add" menu, you can upload the subwindows for the inputs, outputs, markers... in order to monitor and control the program. 5 To simulate another CPU, you execute the menu command "Simulation > New PLC" in S7PLCSIM. The "S7PLCSIM2" dialog opens. 6 For the second CPU to be simulated, you select the interface parameterization (PG/PC interface) configured in the hardware configuration. Fig. 01 shows an example of communication between two S7400 CPU modules. In S7PLCSIM1 (simulation for Station 1), EB1 controls counter Z1 and transfers the counter value to the AW1 in S7PLCSIM2 (simulation for Station 2). Associated product(s) Entry Home (start) Product Support (http://www.siemens.com)

description

How Do You Simulate Communication Between Two CPU Modules

Transcript of How Do You Simulate Communication Between Two CPU Modules

  • IndustryOnlineSupportProductSupport

    Entrytype:FAQ,EntryID:38726591,Entrydate:08/23/2010

    HowdoyousimulatecommunicationbetweentwoCPUmodules?Rate(1)

    Instructions:AsfromS7PLCSIMV5.4+SP3youcanuseS7PLCSIMtosimulatemultipleCPUmodulessimultaneouslyinaSTEP7projectandestablishcommunicationbetweentheCPUmodules.Thefollowingcommunicationblocksaresupportedforcommunication:

    SFB8"USEND"SFB9"URCV"SFB12"BSEND"SFB13"BRCV"SFB15"PUT"SFB14"GET"SFB19"START"SFB20"STOP"SFB22"STATUS"SFB23"USTATUS"

    Duringcommunication,theremightbetimerestrictionsbecauseS7PLCSIMdoesnotsupportrealtime.

    PleasealsorefertotheinformationintheS7PLCSIMreadmefile,section7.3.If,whenrunningalargenumberofWindowsprograms,youcannotstartanymoreprogramsoryoucannotopenanymorewindows,thenyoumustchangetheoperatingsystemproperty"desktopheapmemory"ofyourPC.OneremedyisdescribedinTable02(#Marke_1).

    YoucannottestaprogramofyourSTEP7projectwitharealCPU(PLC)atthesametimeasaprogramwithS7PLCSIM.IfyouwishtosimulateyourCPUswithS7PLCSIM,youmustfirstdisconnectallconnectionstotherealCPU.

    ProceedasdescribedinTable01belowtosimulatemultipleCPUmodulessimultaneously.

    No. Procedure:

    1 OpenS7PLCSIMintheSIMATICManager,eitherviathemenucommand"Options>SimulateModules"orfromthemenubarwiththe"Simulationon/off"icon.Thedialogwiththeinstancenumber"S7PLCSIM1"withthefirstsimulatedCPUopens.

    2 Inthe"S7PLCSIM1"dialog,youselecttheconfiguredinterfaceparameterizationfromthedropdownlistboxforthePG/PCinterface.TheMPIinterfaceispresetbydefault.Later,S7PLCSIMstartswiththeinterfacelastused.However,dependingonyourhardwareconfiguration,youcanalsosetthe"PROFIBUS","TCP/IP"(viatheIPaddress),"ISO"(viatheMACaddress)or"Local"(viathevirtualbackplanebus)interface.

    Note:Youmustnotusetheaddressesmorethanonceinthesamesubnetwork.IfyouloadallyourprogramsviatheMPIinterface,forexample,thenthedifferentMPIaddressesmightlooklikethis:

    Station1:MPIaddress:2Station2:MPIaddress:3etc.

    3 IntheSIMATICManager,marktheblockfolderofyourfirstS7stationandloadyourblocksinS7PLCSIM1viathemenucommand"PLC>Upload".

    4 Inthe"CPU"subwindowinS7PLCSIM,changetheoperatingmodefrom"STOP"to"RUNP".Viathe"Add"menu,youcanuploadthesubwindowsfortheinputs,outputs,markers...inordertomonitorandcontroltheprogram.

    5 TosimulateanotherCPU,youexecutethemenucommand"Simulation>NewPLC"inS7PLCSIM.The"S7PLCSIM2"dialogopens.

    6 ForthesecondCPUtobesimulated,youselecttheinterfaceparameterization(PG/PCinterface)configuredinthehardwareconfiguration.Fig.01showsanexampleofcommunicationbetweentwoS7400CPUmodules.InS7PLCSIM1(simulationforStation1),EB1controlscounterZ1andtransfersthecountervaluetotheAW1inS7PLCSIM2(simulationforStation2).

    Associatedproduct(s)Entry

    Home(start) ProductSupport

    (http://www.siemens.com)

  • Fig.01

    Note:IfyouusethesameaddressofthesameinterfaceforbothCPUs,theiteminthedropdownlistisgrayed.TheS7PLCSIMinstanceisnotaccessibleviathisinterface.SelecttheinterfacefromthedropdownlistboxforthePG/PCinterfaceevenifitisalreadyset.ThenthecolorchangesfromgraytoblackandtheS7PLCSIMinstanceisaccessibleviathisinterface.

    7 IntheSIMATICManager,marktheblockfolderofyoursecondCPUandloadalltheblocksintotheinstance"S7PLCSIM2".Youmustselecttheinstance"S7PLCSIM2"beforeloading.Here,too,youaddthesubwindowsrequiredfortheinputs,outputs,markers....

    Note:Executethedownloadonlywhenthecoloroftheinterfaceisblack(asdescribedinStep6above).MoreinformationisavailableintheS7PLCSIMreadmeinsection7.3.2.

    Repeatsteps4to7foreveryotherCPUtobesimulated.

    Table01

    Changingtheoperatingsystemproperty"desktopheapmemory"EvenifyouhavesufficientmainmemoryandexportmemoryinyourPC,youmightgettheerrormessage"Notenoughmainmemory"ortheprogrammightcrashwhenrunningalargenumberofWindowsprograms.OneremedyisdescribedinTable02.

    No. Procedure:

    1 Starttheregistryeditorvia"Start>Run..."andbyentering"Regedt32.exe"inthecommandline.

    2 Openthepath:HKEY_LOCAL_Machine\System\CurrentControlSet\Control\SessionManager\SubSystems

    3 Rightclickon"Windows"andselectthe"Change"functioninthepopupmenu.The"EditString"dialogopens.

    4 The"SharedSection"parameterhasthevalues1024(maximumsizeofthesystemwideheap)and3072(sizeoftheheapperdesktop).Increasethedesktopheapmemoryby512KBbyaddingthevalue512tothe"SharedSection"parameterasshowninFig.02.Thenclick"OK"tosavethesettings.

    SiemensAG20092015 Imprint(http://www.siemens.com/corporate_info) Dataprotectionregulations(http://www.siemens.com/privacy)

    DataprotectionTermsofuse(http://www.siemens.com/terms_of_use) DigitalID(http://www.siemens.com/digital_id_en) 0.0.0.0

  • Alsoavailableinthefollowinglanguages:Deutsch franais italianoespaol

    Entrybelongstoproducttreefolder(s):AutomationTechnologyAutomationSystems IndustrialAutomationSystemsSIMATICSoftwareforSIMATICControllerSTEP7programmingsoftwareS7PLCSIM(products?pnid=14356)

    Rateentry

    Feedback

    Name

    Phonenumber

    email

    CommentNumberofcharacters:0(max.500)

    Sendcopyofcommenttosender

    Fig.02

    WiththeadditionalSharedSectionvalueof512KB,thesizeofthedesktopheapisdefinedforeachdesktopthatisconnectedtoa"noninteractive"workstation.Displayoftheabovementionederrormessageorprogramcrashesshouldnownolongeroccur.

    5 YoumustrebootyourPCtomakethechangestothedesktopheapmemoryeffective.

    Note:MoreinformationisavailableintheInternetontheMicrosoftHelpandSupportpageunderarticleID:KB126962.

    Table02

    Download:Theattacheddownload"S7_PLCSIM_CPU_Communication"containsaSTEP7V5.4projectwiththecommunicationprogramdescribedabove.Copythe"S7_PLCSIM_CPU_Communication.zip"fileintoaseparatedirectoryandthenstartthefilewithadoubleclick.TheSTEP7projectisnowunpackedautomaticallywithalltheassociatedsubdirectories.YoucanthenuseSTEP7toopenandprocesstheextractedproject.

    S7_PLCSIM_CPU_Communication.zip(/cs/attachments/38726591/S7_PLCSIM_CPU_Communication.zip)(431KB)

    CreationenvironmentTable03liststhecomponentsthathavebeenusedtocreatethisentryandverifythefunctiondescribed.

    Testenvironment Version

    PCplatform Intel(R)Core(TM)2DuoCPUP87002.53GHz

    PCoperatingsystem MSWindowsXPSP3

    STEP7 V5.4+SP5

    S7PLCSIM V5.4+SP3Table03

    Keywords:Outofmemory,Multiinstance

    norating

    Send