Making DB's in step 7

taz3m

Member
Join Date
Apr 2008
Location
St pierre
Posts
23
Hi everybody,

I have a request from you, i wanna learn about how to use DB to program a process e.g. a circulation process where inputs are :
  • Level switch
  • Temperature probe
Outputs:
  • Pump
A simple program which can easily be written using FC, i know but i wanna learn how to create DBa and using FB (function Block)

Hope that someone will help, Thanks a lot...

Taz....o_O
 
What do you exactly want?

How to work with an instance DB? I don't know you Siemens level but there are basicly tow types of DB: instance and global.

The first one are auto-generated when you call to a FB and asign some DB to it.

The others, are to be created by the user, who defines the structure of it. The are no input or output var, you only define an memory area to save (or read) the information you read/write on this DB.

Explain a little more what you are asking plis, and I would try to help you If I can...
 
Fb & db

Hi thanks for replying.

Yep i know quite things about siemens, and about the DB there are 2 types that is shared and instance DB.

I would like to start with an instance DB, cause it seems to be easier than the shared DB according to what i read on siemens help page.

I would really like to know the various steps to follow to crteate my FB attached to an instance DB, where all my inputs and outputs are listed there.

There is a variable which is new to me i.e. IN/OUT variable.

If you could please explain the basic steps in creating for e.g. the circulation process using FB and its associated DB so that i can have a better grasp of what you will teach me.

Thanks

Taz :eek:.....:eek:
 
The instance DB is autogenerated as I said.

You may first create the program in the FB declaring the variables that you need on the top of the editor window. The IN/OUT are that, input and output variables, variables that you can read and write, anymore.

When you have your program, you call it from, for example, OB1. When you call it you'll be asked for some DB instance. You may write one (one that you don't have used). Step 7 will say you that this DB doesn't exist and if you want to generate. Then you have the DB generated on your project. Open it and look a little: you'll have all the variables that you've declared on your program.

For using it in another part of the program, you can refare to it like:

DBn.DBx0.0 or DBn.DBB0 or DBn.DBW0... where n is the DB that you generated.


If it's not enough information, ask more.

PS: Sorry for the delay, but I don't have enough time for entering PLCs.net often.
 
When you create the FB, you can assign IN, input paramaters (data you want to pass into the FB), OUT, outputs parameters (data that you want to pass out of the FB), IN_OUT, data you pass in, nmay change and then pass out of the FB and internally you have STAT, internal memory, things to remember states etc within the block and TEMP's, this is throw away data that does not remember the states once you end the FB.

When you call the FB, it will ask you to assign a DB, you give it a free DB address and it will autonmatically create the DB, and it will contain the IN, OUT, IN_OUT and STAT variables that you created in the FB. Nothing less and nothing more, you cannot modify this DB.

The IN_OUT is not required for FB's, this is a parameter for FC's, it can be used but is not necessary as all IN and OUT parameters are stored in the IDB.

The Data Block remember is just storage of Data, it does no processing.

An IDB is just a DB that has been created by the program, it acts in the same way with the exception that you cannot modify its structure, you can call it anywhere in the program and read or modify its contents though, just as any other DB.
 

Similar Topics

Is it possible to make pulses for a stepper drive with an acceleration/deceleration curve of some sort in ladder. I'm using an Automation Direct...
Replies
9
Views
2,587
Hi, I have a simple function block that does not function when I use multi instance SFB4 IEC Timer On Delay. I could not attached a zip of the...
Replies
7
Views
9,086
Hi, I have seen a few post with similar topics and I have tried contacting the authors however I have not had any luck so I am posting this new...
Replies
14
Views
999
Hi everyone I've created an FC that includes the blocks TCON, TDISCON, TSEND and TRCV. This block has to be as generic as possible across...
Replies
15
Views
1,493
Hi all, I have been working on a tool for my company that handles a specific task our company runs into often related to PLC's. This is a tool I...
Replies
15
Views
2,871
Back
Top Bottom