Professional Documents
Culture Documents
com)
IndustryOnlineSupport
ProductSupport
Home(start)
ProductSupport
Entrytype:FAQ,EntryID:38726591,Entrydate:08/23/2010
HowdoyousimulatecommunicationbetweentwoCPUmodules?
Entry Associatedproduct(s)
Instructions:
AsfromS7PLCSIMV5.4+SP3youcanuseS7PLCSIMtosimulatemultipleCPUmodulessimultaneouslyina
STEP7projectandestablishcommunicationbetweentheCPUmodules.Thefollowingcommunicationblocksare
supportedforcommunication:
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,whenrunningalargenumberof
Windowsprograms,youcannotstartanymoreprogramsoryoucannotopenanymorewindows,thenyoumust
changetheoperatingsystemproperty"desktopheapmemory"ofyourPC.OneremedyisdescribedinTable02
(#Marke_1).
YoucannottestaprogramofyourSTEP7projectwitharealCPU(PLC)atthesametimeasaprogramwithS7
PLCSIM.IfyouwishtosimulateyourCPUswithS7PLCSIM,youmustfirstdisconnectallconnectionstothereal
CPU.
ProceedasdescribedinTable01belowtosimulatemultipleCPUmodulessimultaneously.
No. Procedure:
1
OpenS7PLCSIMintheSIMATICManager,eitherviathemenucommand"Options>SimulateModules"or
fromthemenubarwiththe"Simulationon/off"icon.Thedialogwiththeinstancenumber"S7PLCSIM1"with
thefirstsimulatedCPUopens.
Inthe"S7PLCSIM1"dialog,youselecttheconfiguredinterfaceparameterizationfromthedropdownlistbox
forthePG/PCinterface.TheMPIinterfaceispresetbydefault.Later,S7PLCSIMstartswiththeinterfacelast
used.However,dependingonyourhardwareconfiguration,youcanalsosetthe"PROFIBUS","TCP/IP"(via
theIPaddress),"ISO"(viatheMACaddress)or"Local"(viathevirtualbackplanebus)interface.
Note:
Youmustnotusetheaddressesmorethanonceinthesamesubnetwork.Ifyouloadallyourprogramsviathe
MPIinterface,forexample,thenthedifferentMPIaddressesmightlooklikethis:
Station1:MPIaddress:2
Station2:MPIaddress:3
etc.
IntheSIMATICManager,marktheblockfolderofyourfirstS7stationandloadyourblocksinS7PLCSIM1via
themenucommand"PLC>Upload".
Inthe"CPU"subwindowinS7PLCSIM,changetheoperatingmodefrom"STOP"to"RUNP".Viathe"Add"
menu,youcanuploadthesubwindowsfortheinputs,outputs,markers...inordertomonitorandcontrolthe
program.
TosimulateanotherCPU,youexecutethemenucommand"Simulation>NewPLC"inS7PLCSIM.The"S7
PLCSIM2"dialogopens.
(3)
Rate
ForthesecondCPUtobesimulated,youselecttheinterfaceparameterization(PG/PCinterface)configuredin
thehardwareconfiguration.Fig.01showsanexampleofcommunicationbetweentwoS7400CPUmodules.
InS7PLCSIM1(simulationforStation1),EB1controlscounterZ1andtransfersthecountervaluetotheAW1
inS7PLCSIM2(simulationforStation2).
SiemensAG20092016 Imprint(http://www.siemens.com/corporate_info)
Dataprotectionregulations(http://www.siemens.com/privacy)
DataprotectionTermsofuse(http://www.siemens.com/terms_of_use)
Cookiepolicy(http://www.siemens.com/cookiepolicyen)
DigitalID(http://www.siemens.com/digital_id_en) 0.0.0.0
Fig.01
Note:
IfyouusethesameaddressofthesameinterfaceforbothCPUs,theiteminthedropdownlistisgrayed.The
S7PLCSIMinstanceisnotaccessibleviathisinterface.Selecttheinterfacefromthedropdownlistboxfor
thePG/PCinterfaceevenifitisalreadyset.ThenthecolorchangesfromgraytoblackandtheS7PLCSIM
instanceisaccessibleviathisinterface.
7
IntheSIMATICManager,marktheblockfolderofyoursecondCPUandloadalltheblocksintotheinstance
"S7PLCSIM2".Youmustselecttheinstance"S7PLCSIM2"beforeloading.Here,too,youaddthe
subwindowsrequiredfortheinputs,outputs,markers....
Note:
Executethedownloadonlywhenthecoloroftheinterfaceisblack(asdescribedinStep6above).More
informationisavailableintheS7PLCSIMreadmeinsection7.3.2.
Repeatsteps4to7foreveryotherCPUtobesimulated.
Table01
Changingtheoperatingsystemproperty"desktopheapmemory"
EvenifyouhavesufficientmainmemoryandexportmemoryinyourPC,youmightgettheerrormessage"Not
enoughmainmemory"ortheprogrammightcrashwhenrunningalargenumberofWindowsprograms.Oneremedy
isdescribedinTable02.
No. Procedure:
1
Starttheregistryeditorvia"Start>Run..."andbyentering"Regedt32.exe"inthecommandline.
Openthepath:
Rightclickon"Windows"andselectthe"Change"functioninthepopupmenu.The"EditString"dialogopens.
HKEY_LOCAL_Machine\System\CurrentControlSet\Control\SessionManager\SubSystems
The"SharedSection"parameterhasthevalues1024(maximumsizeofthesystemwideheap)and3072(size
oftheheapperdesktop).Increasethedesktopheapmemoryby512KBbyaddingthevalue512tothe
"SharedSection"parameterasshowninFig.02.Thenclick"OK"tosavethesettings.
SiemensAG20092016 Imprint(http://www.siemens.com/corporate_info)
Dataprotectionregulations(http://www.siemens.com/privacy)
DataprotectionTermsofuse(http://www.siemens.com/terms_of_use)
Cookiepolicy(http://www.siemens.com/cookiepolicyen)
DigitalID(http://www.siemens.com/digital_id_en) 0.0.0.0
Fig.02
WiththeadditionalSharedSectionvalueof512KB,thesizeofthedesktopheapisdefinedforeachdesktop
thatisconnectedtoa"noninteractive"workstation.Displayoftheabovementionederrormessageor
programcrashesshouldnownolongeroccur.
5
YoumustrebootyourPCtomakethechangestothedesktopheapmemoryeffective.
Note:
MoreinformationisavailableintheInternetontheMicrosoftHelpandSupportpageunderarticleID:
KB126962.
Table02
Download:
Theattacheddownload"S7_PLCSIM_CPU_Communication"containsaSTEP7V5.4projectwiththecommunication
programdescribedabove.Copythe"S7_PLCSIM_CPU_Communication.zip"fileintoaseparatedirectoryandthen
startthefilewithadoubleclick.TheSTEP7projectisnowunpackedautomaticallywithalltheassociated
subdirectories.YoucanthenuseSTEP7toopenandprocesstheextractedproject.
S7_PLCSIM_CPU_Communication.zip(/cs/attachments/38726591/S7_PLCSIM_CPU_Communication.zip)(431
KB)
Creationenvironment
Table03liststhecomponentsthathavebeenusedtocreatethisentryandverifythefunctiondescribed.
Testenvironment
Version
PCplatform
Intel(R)Core(TM)2DuoCPUP87002.53GHz
PCoperatingsystem
MSWindowsXPSP3
STEP7
V5.4+SP5
S7PLCSIM
Table03
V5.4+SP3
Keywords:
Outofmemory,Multiinstance
Alsoavailableinthefollowinglanguages:
German
French
Italian
Spanish
Chinese
Entrybelongstoproducttreefolder(s):
AutomationTechnology AutomationSystems IndustrialAutomationSystemsSIMATIC SoftwareforSIMATICController STEP7V5.x STEP7programmingsoftware S7PLCSIM(products?pnid=14356)
Rateentry
norating
Submitrating
Feedback*)
Name
Phonenumber
email
Comment Numberofcharacters:0(max.500)
Sendcopyofcommenttosender
*)Note:Donotusethisfeedbackfunctionalityfortechnicalrequests.PleaseusetheSupportRequest(/my/ww/en/requests/#createRequest)instead.
Send