9/7/2009 2:52 PM | |
Posts: 557 Rating:
|
HI Find the attachemnt , hope this will help.... Instance Data BlocksAn instance data block is assigned to every function block call that transfers parameters. The actual parameters and the static data of the FB are saved in the instance DB. The variables declared in the FB determine the structure of the instance data block. Instance means a function block call. If, forexample, a function block is called five times in the S7 user program, there are five instances of this block. Creating an Instance DB Before you create an instance data block, the corresponding FB must already exist. You specify the number of the FB when you create the instance data block. One Instance DB for Each Separate Instance If you assign several instance data blocks to a function block (FB) that controls a motor, you can use this FB to control different motors. The data for each specific motor (for example, speed, runup time, total operating time) are saved in different data blocks. The DB associated with the FB when it is called determines which motor is controlled. With this technique, only one function block is necessary for several motors (see the following figure).
One Instance DB for Several Instances of an FB (Multiple Instances) You can also transfer the instance data for several motors at the same time in one instance DB. To do this, you must program the calls for the motor controllers in a further FB and declare static variables with the data type FB for the individual instances in the declaration section of the calling FB. If you use one instance DB for several instances of an FB, you save memory and optimize the use of data blocks. In the following figure, the calling FB is FB21 "Motor processing," the variables are of data type FB22, and the instances are identified by Motor_1, Motor_2, and Motor_3.
In this example, FB22 does not need its own instance data block, since its instance data are saved in the instance data block of the calling FB. One Instance DB for Several Instances of Different FBs (Multiple Instances) In a function block you can call the instances of other existing FBs. You can assign the instance data required for this to the instance data block of the calling FB, meaning you do not need any additional data blocks for the called FBs in this case. For these multiple instances in one instance data block, you must declare static variables with the data type of the called function block for each individual instance in the declaration section of the calling function block. The call within the function block does not then require an instance data block, only the symbolic name of the variable. In the example in this figure, the assigned instance data are stored in a common instance DB. AttachmentFB.zip (1756 Downloads) |
Last edited by: Eastern at: 9/7/2009 2:54 PM |
|
This contribution was helpful to
3 thankful Users |
9/7/2009 5:55 PM | |
Joined: 10/22/2008 Last visit: 7/26/2024 Posts: 369 Rating:
|
Thank you very much.Thats very simple and i am stupid i didn't try to do this in that way. best regards |
9/8/2009 1:34 PM | |
Posts: 557 Rating:
|
HI yes it is possible in microwin....but instance DB is not their....you can prepare FC like a subroutine...& call in your main program..... regard |
Follow us on