You are on page 1of 26

Siemens Programming Manual

Programming Package for Siemens PLC For Siemens SCADA Software For Siemens Touch Panel Software The Addressing method for Siemens PLC :
IEC I IB IW ID Q QB QW QD M MB MW MD PIB PQB PIW PQW PID PQD T C FB OB DB FC SFB SFC VAT UDT Description Input bit Input byte Input word Input double word Output bit Output byte Output word Output double word Memory bit Memory byte Memory word Memory double word Peripheral input byte Peripheral output byte Peripheral input word Peripheral output word Peripheral input double word Data Type BOOL BYTE, CHAR WORD, INT, S5TIME, DATE DWORD, DINT, REAL, TOD, TIME BOOL BYTE, CHAR WORD, INT, S5TIME, DATE DWORD, DINT, REAL, TOD, TIME BOOL BYTE, CHAR WORD, INT, S5TIME, DATE DWORD, DINT, REAL, TOD, TIME BYTE, CHAR BYTE, CHAR WORD, INT, S5TIME, DATE WORD, INT, S5TIME, DATE DWORD, DINT, REAL, TOD, TIME Address Range 0.0 to 65535.7 0 to 65535 0 to 65534 0 to 65532 0.0 to 65535.7 0 to 65535 0 to 65534 0 to 65532 0.0 to 65535.7 0 to 65535 0 to 65534 0 to 65532 0 to 65535 0 to 65535 0 to 65534 0 to 65534 0 to 65532 0 to 65532 0 to 65535 0 to 65535 0 to 65535 1 to 65535 1 to 65535 0 to 65535 0 to 65535 0 to 65535 0 to 65535 UDT 0 to 65535

SIMATIC STEP 7 V5.3 WINCC Flex 2004 Protool

Peripheral output double word DWORD, DINT, REAL, TOD, TIME Timer Counter Function block Organization block Data block Function System function block System function Variable table Userdefined data type TIMER COUNTER FB OB DB, FB, SFB, UDT FC SFB SFC

Examples :For addressing Digital Inputs :For addressing Digital Outputs :For addressing Analog Inputs :For addressing Analog Outputs :For addressing Memory Bit :For addressing Memory Byte :For addressing Memory Word :For addressing Memory Double Word:I 0.0 Q 2.0 PIW 10 PQW 20 M 0.0 MB 1 MW 20 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 DBs Bool Variable :Real Variable :Int Variable :Word Variable:DB1.DBX1.2 DB1.DBD2 DB2.DBB6 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

Select File / New Step7 Workspace is opened.

Assign Name to Project Test Type as Project Storage Location Where u wants to store the project Then ok New Project is created

for adding SIMATIC 300 Station (PLC is S7 300) Right Click on Test Goto Insert new object SIMATIC 300 Station

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

For adding Modules open HW config by Double clicking Hardware. Then HW config opens Then click insert object for inserting..

For adding Modules we want Rail CPU DI DO etc

Insert Rail By Insert Object / SIMATIC 300 / Rack 300 / Rail

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.

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.

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.

Select Network Parameters Transmission Rate as 1.5Mbps & Profile as DP Then click ok

Profibus Network is added the address is Profibus node address. Now CPU is added in rail.

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.

Now you will see CPU is added into project. Double click on it

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

Blocks used for creating DB, FB, OB, FCs 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.

Then we will see the blocks

Double click on blocks.

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).

Right click on workspace click on insert new object then click function. Then properties window opens.

Name Symbolic name as Motor Click ok. New Function FC1 created.

Double click on FC1.

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

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.

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

Now we created a function called Motor. This function we can use many times for different DI & DOs as well as different times. Save & Close the program editor. Lets we see Go to SIMATIC Manager Double click on OB1

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

in this way we can use functions.

You might also like