Issue
Require details on how to setup a counter to count input activations and trigger an alarm after a certain number has been reached.
Product Line
EcoStruxure Security Expert
Environment
Security Expert
Cause
Unsure how to program a counter and require an example.
Resolution
Need to create:
- 2x Data Value (Data Up, Data Compare)
- 2x Variable (Up Count, Compare)
- 3x Programmable Function (Door Up Count, Value Compare, Reset Alarm)
- 2x Output (vAlarm OP, vReset OP)
Instructions:
Virtual Outputs
- Under Programming | Outputs create two (2) new outputs. One will be the alarm trigger, the other the alarm and counter reset.
- Save changes.
Data Value
- Under Automation | Data Values create two Data Values to store the appropriate data in the system.
- Set the Preset Value for Data Up to 0, and for Data Compare to the number of activations you want to trigger an alarm at. In the example, this is 2.
- Save changes.
Variable
- Under Automation | Variables create two Variables to count in the correct scale for each Data Value.
- Up Count: Set the Scale to 1, MaximumValue to the top end of your counting scale and the Data Value to the Data Up Data Value created earlier.
- Save changes.
- Compare: Set the Scale to 1, MaximumValue to the top end of your counting scale and the Data Value to the Data Compare Data Value.
- Save changes.
Programmable Functions
- Under Automation | Programmable Functions create three new Programmable Functions. Door Up Count to increment the counter register, Value Compare to compare the current register against the setpoint, and ResetAlarm to reset the alarm output
- Door Up Count: Set Type to Register Counter and Mode to Normal
- On the Register Counter tab set Input to Count to the physical input you want to count, Counter Register to Data Up, tick Increment on Input Open, tick Log Counter events, and set Reset Output to vReset OP.
- Save changes.
- Right-click the new Programmable Function just created and select "Start".
- Value Compare: Set Type to Value Compare, Mode to Normal.
- On the Value Compare tab set Activate Output When Above Setpoint to vAlarm OP, Analog Input Data Variable Register to Data Up and Set Point Data Value to Data Compare.
- Save changes.
- Right-click the new Programmable Function just created and select "Start".
- Reset Alarm: Set Type to Logic Control and Mode to Normal.
- On the Logic Control tab set Logic Function Mode to 3 - Inverted Follow Pulse On First Output, First Output To Check to vReset OP and Output To Control to vAlarmOP.
- Save changes.
- Right-click the new Programmable Function just created and select "Start".
Test the Functions:
- Create a Floor Plan with Compare, Up Count, vAlarm OP and vReset OP added so this can be monitored in real-time.
- Pulse the monitored Input and confirm Up Count increments.
- When it gets to the set point value confirm vAlarm OP goes on to trigger an alarm.
- When vReset OP is enabled confirm the Up Count is reset to 0 and vAlarm OP is disabled.