Task:You want to create a DB in Step7 Manager and using it in FC.
Step1: Open your project, S7-300 -> CPU -> S7 Program-> Block and then right click, insert New Block-> Data Block.
Step2:Here is the Windows that after Step1.
Name and Type:DB10 means DB @ Number10, choose the DB number that you like.
Step3:Now in the Blocks, you can see the DB that you created.
Step4:Double Click it to create the variables inside DB.
Step5:In this example I just created a few variables.
Address: the address of the variables. Because variables Data1 is INT Type, the Next variables’s address will start at +2.0.
please take a look on the variables Result. It is a BOOL Type but the next variables Data3 will start at +6.0 at same.do not ask me why because it is the rules of Siemens system:). And also although +4.0 is variable of Result, you can use +4.1 inside the program without assign in here.But i think that is no make sense.
Step6:Here is a sample of using DB in the program.
DB20.DBW0 = the word at address0 in DB20.
DBX4.0 = the bit0 address4 in DB20.
*What Happen if you assign a DB that not exist in your program?
You can save the program but your CPU will change to Error while you download the program.
END*