100BBasic instructions
7.2 Timers
S7-1200 Programmable controller
System Manual, 11/2011, A5E02486680-05
177
Assign a multi-instance DB to store timer data as retentive data
This option only works if you place the timer in an FB.
This option depends upon whether the FB was created with "Optimized" block access
(allows symbolic access only). Once the FB has been created, you cannot change the
checkbox for "Optimized"; it must be chosen correctly when the FB is created, on the first
screen after selecting "Add new block" from the tree. To verify how the access attribute is
configured for an existing FB, right-click on the FB in the Project tree, choose properties, and
then choose attributes.
If the FB was created with the "Optimized" box checked (allows symbolic access only):
1.
Open the FB for edit.
2.
Place the timer instruction at the desired location in the FB.
3.
When the Call options dialog appears, click on the Multi instance icon. The Multi Instance
option is only available if the instruction is being placed into an FB.
4.
In the Call options dialog, rename the timer if desired.
5.
Click OK. The timer instruction appears in the editor, and the IEC_TIMER structure
appears in the FB Interface under Static.
6.
If necessary, open the FB interface editor (may have to click on the small arrow to
expand the view).
7.
Under Static, locate the timer structure that was just created for you.
8.
In the Retain column for this timer structure, change the selection to "Retain". Whenever
this FB is called later from another program block, an instance DB will be created with this
interface definition which contains the timer structure marked as retentive.
If the FB was created with the "Standard - compatible with S7-300/400" box checked (allows
symbolic and direct access):
1.
Open the FB for edit.
2.
Place the timer instruction at the desired location in the FB.
3.
When the Call options dialog appears, click on the multi instance icon. The multi instance
option is only available if the instruction is being placed into an FB.
4.
In the Call options dialog, rename the timer if desired.
5.
Click OK. The timer instruction appears in the editor, and the IEC_TIMER structure
appears in the FB Interface under Static.
6.
Open the block that will use this FB.
7.
Place this FB at the desired location. Doing so results in the creation of an instance data
block for this FB.
8.
Open the instance data block created when you placed the FB in the editor.
9.
Under Static, locate the timer structure of interest. In the Retain column for this timer
structure, check the box to make this structure retentive.