siemens programming manual
TRANSCRIPT
![Page 1: Siemens Programming Manual](https://reader031.vdocuments.mx/reader031/viewer/2022012304/54f906af4a7959d7638b48b1/html5/thumbnails/1.jpg)
Siemens Programming Manual Programming Package for Siemens PLC “ SIMATIC STEP 7 V5.3 “ For Siemens SCADA Software “ WINCC Flex 2004” For Siemens Touch Panel Software “Protool” The Addressing method for Siemens PLC : IEC Description Data Type Address Range
I Input bit BOOL 0.0 to 65535.7
IB Input byte BYTE, CHAR 0 to 65535
IW Input word WORD, INT, S5TIME, DATE 0 to 65534
ID Input double word DWORD, DINT, REAL, TOD, TIME 0 to 65532
Q Output bit BOOL 0.0 to 65535.7
QB Output byte BYTE, CHAR 0 to 65535
QW Output word WORD, INT, S5TIME, DATE 0 to 65534
QD Output double word DWORD, DINT, REAL, TOD, TIME 0 to 65532
M Memory bit BOOL 0.0 to 65535.7
MB Memory byte BYTE, CHAR 0 to 65535
MW Memory word WORD, INT, S5TIME, DATE 0 to 65534
MD Memory double word DWORD, DINT, REAL, TOD, TIME 0 to 65532
PIB Peripheral input byte BYTE, CHAR 0 to 65535
PQB Peripheral output byte BYTE, CHAR 0 to 65535
PIW Peripheral input word WORD, INT, S5TIME, DATE 0 to 65534
PQW Peripheral output word WORD, INT, S5TIME, DATE 0 to 65534
PID Peripheral input double word DWORD, DINT, REAL, TOD, TIME 0 to 65532
PQD Peripheral output double word DWORD, DINT, REAL, TOD, TIME 0 to 65532
T Timer TIMER 0 to 65535
C Counter COUNTER 0 to 65535
FB Function block FB 0 to 65535
OB Organization block OB 1 to 65535
DB Data block DB, FB, SFB, UDT 1 to 65535
FC Function FC 0 to 65535
SFB System function block SFB 0 to 65535
SFC System function SFC 0 to 65535
VAT Variable table 0 to 65535
UDT Userdefined data type UDT 0 to 65535
![Page 2: Siemens Programming Manual](https://reader031.vdocuments.mx/reader031/viewer/2022012304/54f906af4a7959d7638b48b1/html5/thumbnails/2.jpg)
Examples :- For addressing Digital Inputs : - I 0.0 For addressing Digital Outputs :- Q 2.0 For addressing Analog Inputs :- PIW 10 For addressing Analog Outputs :- PQW 20 For addressing Memory Bit :- M 0.0 For addressing Memory Byte :- MB 1 For addressing Memory Word :- MW 20 For addressing Memory Double Word:- MD 36 In Step 7 Data Block (DB) are used as data areas for storing user data. For that want to create a DB. In DB all types of variables are stored. Like INT, DINT, BOOL etc. Addressing for variables used in DB’s Bool Variable :- DB1.DBX1.2 Real Variable :- DB1.DBD2 Int Variable :- DB2.DBB6 Word Variable:- DB4.DBW6 Use Of DB in Program For Ex. If there are 6 Motors with VFD then to store Each Scaled Current or Speed SP etc. use separate DB. In Step7 Various Function Blocks are Created that are used More one or many times in Program. For that ----- Step 1 Create one Function Block (FC01) Step 2 Use that various times in program. That we will see Later. For Creating new Project Go to “Start / Programs / SIMATIC / SIMATIC Manager “ Click On SIMATIC Manager
![Page 3: Siemens Programming Manual](https://reader031.vdocuments.mx/reader031/viewer/2022012304/54f906af4a7959d7638b48b1/html5/thumbnails/3.jpg)
Select File / New Step7 Workspace is opened.
![Page 4: Siemens Programming Manual](https://reader031.vdocuments.mx/reader031/viewer/2022012304/54f906af4a7959d7638b48b1/html5/thumbnails/4.jpg)
Assign Name to Project “Test” Type as “Project” Storage Location Where u wants to store the project Then ok New Project is created…
![Page 5: Siemens Programming Manual](https://reader031.vdocuments.mx/reader031/viewer/2022012304/54f906af4a7959d7638b48b1/html5/thumbnails/5.jpg)
for adding SIMATIC 300 Station (PLC is S7 300) Right Click on Test Goto Insert new object SIMATIC 300 Station
![Page 6: Siemens Programming Manual](https://reader031.vdocuments.mx/reader031/viewer/2022012304/54f906af4a7959d7638b48b1/html5/thumbnails/6.jpg)
Then new SIMATIC 300 Station Is Added. Rename as “PLC 1” or what u want. That is PLC added to your Project.
Now you want to add hardware modules for that Double Click on PLC1
![Page 7: Siemens Programming Manual](https://reader031.vdocuments.mx/reader031/viewer/2022012304/54f906af4a7959d7638b48b1/html5/thumbnails/7.jpg)
For adding Modules open HW config by Double clicking Hardware. Then HW config opens Then click insert object for inserting…..
![Page 8: Siemens Programming Manual](https://reader031.vdocuments.mx/reader031/viewer/2022012304/54f906af4a7959d7638b48b1/html5/thumbnails/8.jpg)
For adding Modules we want Rail CPU DI DO etc
![Page 9: Siemens Programming Manual](https://reader031.vdocuments.mx/reader031/viewer/2022012304/54f906af4a7959d7638b48b1/html5/thumbnails/9.jpg)
Insert Rail By Insert Object / SIMATIC 300 / Rack 300 / Rail
![Page 10: Siemens Programming Manual](https://reader031.vdocuments.mx/reader031/viewer/2022012304/54f906af4a7959d7638b48b1/html5/thumbnails/10.jpg)
The rail is added. Rail having 11 rows. 1st Row for Power supply 2nd row For CPU 3rd is for Interface module if 2 racks are there. From 4th row all for AI, DO, AI, AO.
![Page 11: Siemens Programming Manual](https://reader031.vdocuments.mx/reader031/viewer/2022012304/54f906af4a7959d7638b48b1/html5/thumbnails/11.jpg)
For adding CPU 315-2DP On right side select SIMATIC 300 / CPU-300 / CPU 315-2DP then select CPU as per catalog no. The features also seen at bottom side. The green color indicates CPU fits in 2 position. Double click to add into rail.
![Page 12: Siemens Programming Manual](https://reader031.vdocuments.mx/reader031/viewer/2022012304/54f906af4a7959d7638b48b1/html5/thumbnails/12.jpg)
If the we want to connect CPU on Profibus Network then Click New Then new window opens. In general tab rename the Profibus name is you want. Then goto Network Settings tab.
![Page 13: Siemens Programming Manual](https://reader031.vdocuments.mx/reader031/viewer/2022012304/54f906af4a7959d7638b48b1/html5/thumbnails/13.jpg)
Select Network Parameters Transmission Rate as “1.5Mbps” & Profile as “DP” Then click ok
![Page 14: Siemens Programming Manual](https://reader031.vdocuments.mx/reader031/viewer/2022012304/54f906af4a7959d7638b48b1/html5/thumbnails/14.jpg)
Profibus Network is added the address is Profibus node address. Now CPU is added in rail.
![Page 15: Siemens Programming Manual](https://reader031.vdocuments.mx/reader031/viewer/2022012304/54f906af4a7959d7638b48b1/html5/thumbnails/15.jpg)
Then for adding DI module on right pane goto SIMAIC 300 / SM-300 / DI-300 / & select DI module as per catalog No. & double click it. As same all DI, DO, AI, AO modules are added. At the End save configuration. & close HW config. Now come again in to SIMATIC Manager.
![Page 16: Siemens Programming Manual](https://reader031.vdocuments.mx/reader031/viewer/2022012304/54f906af4a7959d7638b48b1/html5/thumbnails/16.jpg)
Now you will see CPU is added into project. Double click on it
![Page 17: Siemens Programming Manual](https://reader031.vdocuments.mx/reader031/viewer/2022012304/54f906af4a7959d7638b48b1/html5/thumbnails/17.jpg)
Now it will show Connections & S7 Program.(1) If You click on Connection it will open network configuration But for single PLC it is not required. Double click on S7 program (1) it shows
![Page 18: Siemens Programming Manual](https://reader031.vdocuments.mx/reader031/viewer/2022012304/54f906af4a7959d7638b48b1/html5/thumbnails/18.jpg)
Blocks used for creating DB, FB, OB, FC’s Main program is done in blocks. Sources Symbols this is table of symbols if we used Mbits Mwords then to assign name to it or any Inputs Outputs this table is used. For ex. This is table created for Input & outputs.
![Page 19: Siemens Programming Manual](https://reader031.vdocuments.mx/reader031/viewer/2022012304/54f906af4a7959d7638b48b1/html5/thumbnails/19.jpg)
Then we will see the blocks Double click on blocks.
![Page 20: Siemens Programming Manual](https://reader031.vdocuments.mx/reader031/viewer/2022012304/54f906af4a7959d7638b48b1/html5/thumbnails/20.jpg)
Only OB1 is there. OB1 is the main block. Here we call the function blocks or function. OB :- Organization Block FB :- Function Block DB :- Data Block FC :- Function Now we will create a function FC :- Assume in application if START input comes After that 2 secs on the motor. Like this we have 5 motors. Then we will create 1 function as “Motor” (FC1).
![Page 21: Siemens Programming Manual](https://reader031.vdocuments.mx/reader031/viewer/2022012304/54f906af4a7959d7638b48b1/html5/thumbnails/21.jpg)
Right click on workspace click on insert new object then click function. Then properties window opens.
![Page 22: Siemens Programming Manual](https://reader031.vdocuments.mx/reader031/viewer/2022012304/54f906af4a7959d7638b48b1/html5/thumbnails/22.jpg)
Name Symbolic name as “Motor” Click ok. New Function FC1 created. Double click on FC1.
![Page 23: Siemens Programming Manual](https://reader031.vdocuments.mx/reader031/viewer/2022012304/54f906af4a7959d7638b48b1/html5/thumbnails/23.jpg)
Then Programming workspace opens. In workspace “Interface” is used if the function have inputs & outputs like we have one digital input, 1 digital output, setting time for output. The inputs to function are added in Interface IN Name DI_01 Data type BOOL IN Name Time_In Data type S5Time OUT Name DO_02 Data type BOOL
![Page 24: Siemens Programming Manual](https://reader031.vdocuments.mx/reader031/viewer/2022012304/54f906af4a7959d7638b48b1/html5/thumbnails/24.jpg)
Variables added in Interface then the variables are use as per program. For ex above view. Here if input DI_01 is true then timer T1 is starts after time given in Time_In then DO_02 is turned ON. Now we created a function called Motor. This function we can use many times for different DI & DO’s as well as different times. Save & Close the program editor. Let’s we see… Go to SIMATIC Manager Double click on OB1
Timer in Step 7 the format for Preset value is in for of S5t#11M3S for mat means 11minutes & 3 seconds. So if you want to give preset value Format is S5t#__M__S
![Page 25: Siemens Programming Manual](https://reader031.vdocuments.mx/reader031/viewer/2022012304/54f906af4a7959d7638b48b1/html5/thumbnails/25.jpg)
Call Motor Function from left pane By clicking FC blocks FC1 Motor Then block is added we want to address DI_01 & DO_02 Give Input address as motor 1 Give Output address as motor 1 Time for Motor 1 on after DI_01 on Now add FC1 again for motor 2 Give Input address as motor 2 Give Output address as motor 2 Time for Motor 2 on after DI_01 on
![Page 26: Siemens Programming Manual](https://reader031.vdocuments.mx/reader031/viewer/2022012304/54f906af4a7959d7638b48b1/html5/thumbnails/26.jpg)
in this way we can use functions.