How to count input activations.

Issue

Require details on how to setup a counter to count input activations and trigger an alarm after a certain number have been reached.

Product Line

SmartStruxure Solution, Other

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

  1. Under Programming | Outputs create two (2) new outputs. One will be the alarm trigger, the other the alarm and counter reset.
  2. Save changes.

 

Data Value

  1. Under Automation | Data Values create two Data Values to store the appropriate data in the system.
  2. 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.
  3. Save changes.

 

Variable

  1. Under Automation | Variables create two Variables to count in the correct scale for each Data Value.
  2. 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.
  3. Save changes.
  4. 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.
  5. Save changes.

 

Programmable Functions

  1. 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
  2. Door Up Count: Set Type to Register Counter and Mode to Normal.
  3. 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.
  4. Save changes.
  5. Right click the new Programmable Function you just created and select "Start".
  6. Value Compare: Set Type to Value Compare, Mode to Normal.
  7. 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.
  8. Save changes.
  9. Right click the new Programmable Function you just created and select "Start".
  10. Reset Alarm: Set Type to Logic Control and Mode to Normal.
  11. 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.
  12. Save changes.
  13. Right click the new Programmable Function you just created and select "Start".

 

Test the Functions:

  1. Create a Floor Plan with Compare, Up Count, vAlarm OP and vReset OP added so we can monitor in real-time.
  2. Pulse your monitored Input and confirm Up Count increments.
  3. When it gets to the set point value confirm vAlarm OP goes on to trigger an alarm.
  4. When vReset OP is enabled confirm the Up Count is reset to 0 and vAlarm OP is disabled.