Siemens S7-1200 System Manual page 224

Hide thumbs Also See for S7-1200:
Table of Contents

Advertisement

Basic instructions
7.3 Counter operations
Counter Data Type
Assign a multi-instance DB to store counter data as retentive data
This option only works if you place the counter in an FB.
This option depends upon whether the FB properties specify "Optimized block access"
(allows symbolic access only). 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 specifies "Optimized block access" (allows symbolic access only):
1. Open the FB for edit.
2. Place the counter 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 counter if desired.
5. Click OK. The counter instruction appears in the editor with type INT for the preset and
count values, and the IEC_COUNTER structure appears in the FB Interface under Static.
6. If desired, change the type in the counter instruction from INT to one of the other types.
The counter structure will change correspondingly.
7. If necessary, open the FB interface editor (may have to click on the small arrow to expand
the view).
8. Under Static, locate the counter structure that was just created for you.
9. In the Retain column for this counter 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 counter structure marked as
retentive.
If the FB does not specify "Optimized block access", then the block access type is standard,
which is compatible with S7-300/400 classic configurations and allows symbolic and direct
access. To assign a multi-instance to a standard block access FB, follow these steps:
1. Open the FB for edit.
2. Place the counter 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 counter if desired.
224
IEC_Counter
IEC_SCounter
IEC_DCounter
IEC_UCounter
IEC_USCounter
IEC_UDCounter
Corresponding Type for the Preset and Count
Values
INT
SINT
DINT
UINT
USINT
UDINT
S7-1200 Programmable controller
System Manual, 03/2014, A5E02486680-AG

Advertisement

Table of Contents
loading

Table of Contents