Professional Documents
Culture Documents
Siemens C - COUNT - 009 Manual
Siemens C - COUNT - 009 Manual
2
Function Block Library ILS_CEM
Function Description Edition 07/16
Counter C_COUNT
Safety Guidelines
This manual contains notices you have to observe in order to ensure your personal safety, as well as to prevent damage
to property. The notices referring to your personal safety are highlighted in the manual by a safety alert symbol, notices
referring to property damage only have no safety alert symbol. The notices shown below are graded according to the
degree of danger.
Danger
! indicates that death or severe personal injury will result if proper precautions are not taken.
Warning
! indicates that death or severe personal injury may result if proper precautions are not taken.
Caution
! with a safety alert symbol indicates that minor personal injury can result if proper precautions are not
taken.
Caution
without a safety alert symbol indicates that property damage can result if proper precautions are not
taken.
Attention
indicates that an unintended result or situation can occur if the corresponding notice is not taken into
account.
If more than one degree of danger is present, the warning notice representing the highest degree of danger will be used.
A notice warning of injury to persons with a safety alert symbol may also include a warning relating to property damage.
Qualified Personnel
The device/system may only be set up and used in conjunction with this documentation. Commissioning and operation
of a device/system may only be performed by qualified personnel. Within the context of the safety notices in this
documentation qualified persons are defined as persons who are authorized to commission, ground and label devices,
systems and circuits in accordance with established safety practices and standards.
Prescribed Usage
Note the following:
Warning
! This device and its components may only be used for the applications described in the catalog or the
technical description, and only in connection with devices or components from other manufacturers
which have been approved or recommended by Siemens.
Correct, reliable operation of the product requires proper transport, storage, positioning and assembly
as well as careful operation and maintenance.
Trademarks
All names identified by ® are registered trademarks of the Siemens AG.
The remaining trademarks in this publication may be trademarks whose use by third parties for their own purposes
could violate the rights of the owner.
Siemens AG
Automation and Drives Siemens AG 2005
Postfach 4848, 90327 Nuremberg, Germany Technical data subject to change.
Siemens Aktiengesellschaft
Reference Manual Objects Counter C_COUNT
COUNTER C_COUNT 1
Description of C_COUNT 4
Type/Number 4
Calling OBs 4
Function 5
Operating principle 7
Input interfaces 7
Process values 10
Input/Output interfaces 10
Output interfaces 11
Time characteristics 13
Message characteristics 13
Commands 13
I/O-bar of C_COUNT 14
OS-Variable table 16
Variable details 17
N:\00_Cemat_Entwicklung\V8\V8200\30_Doku\Doku_Englisch\Reference\Objekte\000_Normal\C_COUNT_009.doc
Counter C_COUNT Reference Manual Objects
Description of C_COUNT
Type/Number
Module name: C_COUNT
Module no.: FB1015
Calling OBs
C_COUNT must be called in every cycle (e.g. OB35 (100MS_TASK)).
N:\00_Cemat_Entwicklung\V8\V8200\30_Doku\Doku_Englisch\Reference\Objekte\000_Normal\C_COUNT_009.doc
Reference Manual Objects Counter C_COUNT
Function
The Counter module C_COUNT can be used to acquire counter values and to make it available
for the visualization. Depending on the parameterization the following options can be selected:
a) Pulse acquisition (via input CNZS or structure input PV_Puls)
b) Reading an accumulated value as differential value (via input VAL_CNT). After reading the
value, the data source is deleted.
c) Reading an accumulated value as result of a measurement (transfer function)
(via input VAL_CNT or the structure inputs PV_Int or PV_Real)
The counted pulses/accumulated value is multiplied with factor PULS_VAL and the result is
available at output RT_OS_O and structure output PV_Out.
Note: In case of using pulses or counter values from input cards, you have to read the inputs from
! the process image and never directly from the periphery.
Direct connection to the periphery input leads to permanent entries into the diagnosis buffer in
case of periphery failure.
Pulse acquisition:
Parameterization:
MODE_V = 0
Function:
It the pulse evaluation is enabled (1-Signal at REL_PULS), each positive edge at input signal
CNZS or PV_Puls increments the pulse counter by 1. The pulse counter is multiplied with factor
PULS_VAL and transferred to the output RT_OS_O (REAL format) and to the output PV_Out
(Structure).
The input signals must be so structured that the pulse duration and the pulse pause are each
longer than the cycle-time of the calling OB.
N:\00_Cemat_Entwicklung\V8\V8200\30_Doku\Doku_Englisch\Reference\Objekte\000_Normal\C_COUNT_009.doc
Counter C_COUNT Reference Manual Objects
This is only possible if input VAL_CNT is used. With the new structure inputs PV_Int and PV_Real
! this function is not possible.
In this case resetting the counter value via RESET button is not possible because the input is
! permanently available and the program will immediately overwrite the counter value.
N:\00_Cemat_Entwicklung\V8\V8200\30_Doku\Doku_Englisch\Reference\Objekte\000_Normal\C_COUNT_009.doc
Reference Manual Objects Counter C_COUNT
Operating principle
Input interfaces
CNZS Pulse signal (digital input)
Format POINTER
The pulse signal which is to be acquired has to be connected to the interface CNZS. With each
positive edge the internal pulse counter value is incremented by 1.
Caution: If the structure input PV_Puls is connected, CNZS will not be evaluated any more
!
PV_Puls Pulse signal (digital input)
Format STRUCT
For function description, see CNZS. This interface can be connected with a structure output, e. g.
with the output of a PCS7 Driver block.
The structure input PV_Puls has higher priority than input CNZS.
!
Structure variables:
PV_Puls.Value Signal Basic state 0-signal
Format BOOL
PV_Puls.ST Signal status Default: 16#FF
Format BYTE
! The structure inputs PV_Int and PV_Real can only be used if NEW_VAL = 0-Signal.
N:\00_Cemat_Entwicklung\V8\V8200\30_Doku\Doku_Englisch\Reference\Objekte\000_Normal\C_COUNT_009.doc
Counter C_COUNT Reference Manual Objects
! In the "overwrite mode" resetting the counter value via RESET button is not possible because the
input is permanently available and the program will immediately overwrite the counter value.
Structure variables:
PV_Int.Value Value Default: 0
Format INTEGER
PV_Int.ST Signal status Default: 16#FF
Format BYTE
N:\00_Cemat_Entwicklung\V8\V8200\30_Doku\Doku_Englisch\Reference\Objekte\000_Normal\C_COUNT_009.doc
Reference Manual Objects Counter C_COUNT
! If the structure input PV_Int is connected the input PV_Real is not evaluated any more.
Structure variables:
PV_Real.Value Value Default: 0.0
Format REAL
PV_Real.ST Signal status Default: 16#FF
Format BYTE
N:\00_Cemat_Entwicklung\V8\V8200\30_Doku\Doku_Englisch\Reference\Objekte\000_Normal\C_COUNT_009.doc
Counter C_COUNT Reference Manual Objects
Process values
The process values can be set during engineering and they can be changed online from the OS.
To permit the modification of the process values from the faceplates, they must not be connected
in the CFC.
Input/Output interfaces
RES_RTOS Date/Time for counter reset from OS Default: 16#00
Format DWORD
Interface to OS
RT_MIH Counted pulses (refr. every hour) (32 bit) Default: 16#00
Format DWORD
Result of the counted value (raw value) in DWORD format. The variable will only be filled if pulse
input (CNZS or PV_Puls) is available. If the accumulated counter value is read, RT_MIH remains
unchanged.
Prepared as interface to OS (can be transferred to the OS if required)
N:\00_Cemat_Entwicklung\V8\V8200\30_Doku\Doku_Englisch\Reference\Objekte\000_Normal\C_COUNT_009.doc
Reference Manual Objects Counter C_COUNT
Output interfaces
RT_OS_O Counter value Default: 0.0
Format REAL
Interface to OS
RT_MIH_O Counted pulses (refr. every hour) (32 bit) Default: 16#00
Format DWORD
Result of the counted value (raw value) in DWORD format
Prepared as interface to OS
N:\00_Cemat_Entwicklung\V8\V8200\30_Doku\Doku_Englisch\Reference\Objekte\000_Normal\C_COUNT_009.doc
Counter C_COUNT Reference Manual Objects
N:\00_Cemat_Entwicklung\V8\V8200\30_Doku\Doku_Englisch\Reference\Objekte\000_Normal\C_COUNT_009.doc
Reference Manual Objects Counter C_COUNT
Time characteristics
The run sequence for the counter can be chosen as desired.
Message characteristics
The C_COUNT has no Messages.
Commands
Refer to Variable details for the assignment of the command word.
N:\00_Cemat_Entwicklung\V8\V8200\30_Doku\Doku_Englisch\Reference\Objekte\000_Normal\C_COUNT_009.doc
Counter C_COUNT Reference Manual Objects
I/O-bar of C_COUNT
C_COUNT
Permitted
Element Meaning Format Default Type Attr. HMI
Values
Counter value
VAL_CNT ANY I
(already counted pulses)
Counter value
PV_Int STRUCT I
(already counted pulses)
Counter value
PV_Real STRUCT I
(already counted pulses)
STRING
UNIT Unit ‘%‘ I +
[8]
Counter value
RT_H REAL 0.0 IO U +
(refreshed every hour)
Counted pulses
RT_MIS DWORD 16#00 IO U
32 Bit DWORD
Counter pulses
RT_MIH 32 Bit DWORD DWORD 16#00 IO U
(refreshed every hour)
N:\00_Cemat_Entwicklung\V8\V8200\30_Doku\Doku_Englisch\Reference\Objekte\000_Normal\C_COUNT_009.doc
Reference Manual Objects Counter C_COUNT
Permitted
Element Meaning Format Default Type Attr. HMI
Values
Counter value
RT_H_O REAL 0.0 O U
(refreshed every hour)
Counter value
PV_OutH STRUCT O U
(refreshed every hour)
Counted pulses
RT_MIS_O DWORD 16#00 O U
32 Bit DWORD
Counter pulses
RT_MIH_O 32 Bit DWORD DWORD 16#00 O U
(refreshed every hour)
N:\00_Cemat_Entwicklung\V8\V8200\30_Doku\Doku_Englisch\Reference\Objekte\000_Normal\C_COUNT_009.doc
Counter C_COUNT Reference Manual Objects
OS-Variable table
C_COUNT
PLC Data
OS Variable Description OS Data Type
Type
PULS_VAL Value of one pulse REAL 32-bit floating-point number IEEE 754
STRING
UNIT Unit Text variable 8-bit character set
[8]
Date/Time for counter reset
RES_RTOS DWORD Unsigned 32-bit value
from OS
RT_OS Counter value REAL 32-bit floating-point number IEEE 754
Counter value
RT_H REAL 32-bit floating-point number IEEE 754
(refreshed every hour)
N:\00_Cemat_Entwicklung\V8\V8200\30_Doku\Doku_Englisch\Reference\Objekte\000_Normal\C_COUNT_009.doc
Reference Manual Objects Counter C_COUNT
Variable details
Internal structure of the Commands word:
COM_B10 8
COM_B11 9
COM_B12 10
COM_B13 11
COM_B14 12
COM_B15 13
COM_B16 14
COM_B17 15
N:\00_Cemat_Entwicklung\V8\V8200\30_Doku\Doku_Englisch\Reference\Objekte\000_Normal\C_COUNT_009.doc