Pulse counter
Couldn't load pickup availability
Description
The FB_Impulszaehler function block counts transmitted pulses using edge detection and briefly displays each detected pulse via an internal timer. Realistic contact mapping is achieved using normally closed ( #NO_13_14
) and normally open ( #NC_21_22
) contacts, which are only active when the virtual enable inputs are set. The block offers reset, deactivation, and diagnostic functions.
Note: This logic is designed as a template. It must be reviewed, adjusted, and approved by qualified personnel before productive use. Incorrect integration may result in incorrect counting or unwanted switching behavior.
How it works
Reset
#Reset
resets the counter ( #Count
), edge detection ( #risingEdge
, #prevImpulse
), and the extension timer. The block restarts from scratch.
Disabled
If #Enable
is not active, the outputs remain inactive. The block does not report any errors; the status indicates a neutral state.
Pulse detection
Rising edges of the input signal #Impulse
are detected by comparing them with the previous state ( #risingEdge
). With each rising edge, the counter #Count
is incremented and the extension timer ( #pulseTimer
) is started, giving the pulse a defined visibility duration.
Contact logic
The simulated contacts reflect the state of the extension timer, only if the corresponding enable inputs are set:
-
#NO_13_14
(normally closed) is active if#Input_13
is set and the pulse extension timer is set (#pulseTimer.Q
). -
#NC_21_22
(normally open) is active when#Input_21
is set and no pulse is visible (inverted).
Technical details
-
Inputs:
#Enable
,#Reset
,#Impulse
,#Input_13
,#Input_21
-
Internal logic: Edge detection via
#prevImpulse
, pulse extension with#pulseTimer
-
Counter:
#Count
– counted number of rising edges -
Outputs:
#NO_13_14
(normally closed when pulse is visible),#NC_21_22
(normally closed when no pulse is present) -
Status & Diagnosis:
#Error
,#Status
,#DiagnosticCode
-
Delay:
T#100ms
to visualize individual pulses - Modes: Reset, disabled, running
Possible applications
- Pulse counting for sensors, flow measurement or switching operations
- Extended display of individual pulses for better evaluation
- Simulation of contact states via virtual release inputs
- Integration into diagnostic or control systems for event counting
Note: Before productive use, a technical inspection and approval by qualified personnel is required.
compatibility
- Can be used in PLC projects with SCL support (e.g. Siemens TIA Portal)
- Integration into higher-level control and monitoring architectures possible
- Virtual contacts allow testing without physical output hardware
- Safe state when deactivated
Scope of delivery
You will receive:
- An SCL file with the implemented function block FB_Impulszaehler
- Complete declaration of all inputs/outputs and internal states
- Annotated structure for quick adaptation
- Quick guide to integration into automation projects
The download link will be provided after purchase.
Support
I support you with:
- Adjustment of edge detection and pulse stretching
- Integration into counting and evaluation systems
- Testing and simulation without a real signal source
- Special adaptations for individual requirements
Contact is possible via shop message or email. Extensions are available as optional customizations.