Alarm (ALM)
This information applies to the
CompactLogix
5370, ControlLogix
5570, Compact GuardLogix
5370, GuardLogix
5570, Compact GuardLogix
5380, CompactLogix
5380, CompactLogix
5480, ControlLogix
5580, and GuardLogix
5580 controllers.The Alarm (ALM) instruction provides alarming for any analog signal.
Available Languages
Ladder Diagram
This instruction is not available in ladder diagram logic.
Function Block
Structured Text
ALM(ALM_tag)
Operands
Function Block
Operand | Type | Format | Description |
ALM tag | ALARM | structure | ALM structure |
Structured Text
Operand | Type | Format | Description |
ALM tag | ALARM | structure | ALM structure |
See
Structured Text Syntax
for more information on the syntax of expressions within structured text.ALARM Structure
Input Parameter | Data Type | Description |
---|---|---|
EnableIn | BOOL | Enable input. If false, the instruction does not execute and outputs are not updated.
Default is true. |
In | REAL | The analog signal input.
Valid = any float
Default = 0.0 |
HHLimit | REAL | The high-high alarm limit for the input.
Valid = any real value
Default = maximum positive value |
HLimit | REAL | The high alarm limit for the input.
Valid = any real value
Default = maximum positive value |
LLimit | REAL | The low alarm limit for the input.
Valid = any real value
Default = maximum negative value |
LLLimit | REAL | The low-low alarm limit for the input.
Valid = any real value
Default = maximum negative value |
Deadband | REAL | The alarm deadband for the high-high to low-low limits
Valid = any real value 0.0
Default = 0.0 |
ROCPosLimit | REAL | The rate-of-change alarm limit in units per second for a positive (increasing) change in the input. Set ROCPosLimit = 0 to disable ROC positive alarming. If invalid, the instruction assumes a value of 0.0 and sets the appropriate bit in Status.
Valid = any real value 0.0
Default = 0.0 |
ROCNegLimit | REAL | The rate-of-change alarm limit in units per second for a negative (decreasing) change in the input. Set ROCNegLimit = 0 to disable ROC negative alarming. If invalid, the instruction assumes a value of 0.0 and sets the appropriate bit in Status.
Valid = any real value 0.0
Default = 0.0 |
ROCPeriod | REAL | Time period in seconds for calculation (sampling interval) of the rate of change value. Each time the sampling interval expires, a new sample of In is stored, and ROC is re-calculated. Instead of an enable bit like other conditions in the analog alarm, the rate-of-change detection is enabled by putting any non-zero value in the ROCPeriod. Valid = 0.0 to 32767.0 Default = 0.0. |
Output Parameter | Data Type | Description |
---|---|---|
EnableOut | BOOL | Indicates if instruction is enabled. Cleared to false if ROC overflows. |
HHAlarm | BOOL | The high-high alarm indicator.
Default = false |
HAlarm | BOOL | The high alarm indicator.
Default = false |
LAlarm | BOOL | The low alarm indicator.
Default = false |
LLAlarm | BOOL | The low-low alarm indicator.
Default = false |
ROCPosAlarm | BOOL | The rate-of-change positive alarm indicator.
Default = false |
ROCNegAlarm | BOOL | The rate-of-change negative alarm indicator.
Default = false |
ROC | REAL | The rate-of-change output. |
Status | DINT | Status of the function block. |
InstructFault (Status.0) | BOOL | The instruction detected one of the following execution errors. This is not a minor or major controller error. Check the remaining status bits to determine what occurred. |
DeadbandInv (Status.1) | BOOL | Invalid Deadband value. |
ROCPosLimitInv (Status.2) | BOOL | Invalid ROCPosLimit value. |
ROCNegLimitInv (Status.3) | BOOL | Invalid ROCNegLimit value. |
ROCPeriodInv (Status.4) | BOOL | Invalid ROCPeriod value. |
Description
The ALM instruction provides alarm indicators for high-high, high, low, low-low, rate-of-change positive, and rate-of-change negative. An alarm deadband is available for the high-high to low-low alarms. A user-defined period for performing rate-of-change alarming is also available.
High-high to Low-low Alarm
The high-high and low-low alarm algorithms compare the input to the alarm limit and the alarm limit plus or minus the deadband.
Rate-of-change Alarm
The rate-of-change (ROC) alarm compares the change of the input over the ROCPeriod to the rate-of-change limits. The ROCPeriod provides a type of deadband for the rate-of-change alarm. For example, define an ROC alarm limit of 2
O
F/second with a period of execution of 100 ms. If you use an analog input module with a resolution of 1O
F, every time the input value changes, an ROC alarm is generated because the instruction calculates an effective rate of 10°F/second. However, enter an ROCPeriod of 1 sec and the instruction only generates an alarm if the rate truly exceeds the 2O
F/second limit.The ROC alarm calculates the rate-of-change as:
The instruction performs this calculation when the ROCPeriod expires. Once the instruction calculates the ROC, it determines alarms as:
Monitoring the ALM Instruction
There is an operator faceplate available for the ALM instruction.
Affects Math Status Flags
No
Major/Minor Faults
None specific to this instruction. See
Common Attributes
for operand-related faults.Execution
Function Block
Condition/State | Action Taken |
---|---|
Prescan | Rung-condition-in bits are cleared to false. |
Rung-condition-in is false | Rung-condition-in bits are cleared to false. |
Rung-condition-in is true | Rung-condition-in bits are set to true. The instruction executes. |
Postscan | Rung-condition-in bits are cleared to false. |
Structured Text
Condition/State | Action Taken |
---|---|
Prescan | See Prescan in the Function Block table. |
Normal Execution | See Rung-condition-in is true in the Function Block table. |
Postscan | See Postscan in the Function Block table. |
Example
The ALM instruction is typically used either with analog input modules (such as 1771 I/O modules) that do not support on-board alarming, or to generate alarms on a calculated variable. In this example, an analog input from a 1771-IFE module is first scaled to engineering units using the SCL instruction. The Out of the SCL instruction is an input to the ALM instruction to determine whether to set an alarm. The resulting alarm output parameters could then be used in your program and/or viewed on an operator interface display.
Function Block
Structured Text
SCL_01.IN := Input0From1771IFE;
SCL(SCL_01);
ALM_01.IN := SCL_01.Out;
ALM(ALM_01);
Provide Feedback