SCL (scaler with alarm)

The SCL instruction converts an unscaled REAL input value to a REAL floating point value in engineering units and includes alarming and limiting of the output.
Languages supported: Function block diagram, ladder diagram, structured text.
This instruction applies to the L20E, L50E, and L70E controllers.
SCL
SCL
SCL parameters
Parameter
Parameter Type
Data Type
Description
Enable
Input
BOOL
  • TRUE: Rising edge detected.
    • If InRawMin >= InRawMax, Status.0 and Status.1 bits are set to 1. Done is cleared, MaxAlarm and MinAlarm are cleared. Error is set to TRUE and ErrorID is set to 1.
    • Else Out is calculated first. Then alarm conditions are verified. If MaxAlarm is set, MinAlarm is cleared and vice versa. Then if limiting is set, Out will be in the range of InEUMin and InEUMax. Then Done bit is set to TRUE. Status bits are set to 0. Error and ErrorID are set to 0.
    • The calculated Out value is compared against NAN (Not a Number). If NAN is the Out value, EnableOut is cleared. Done is cleared if fault condition is set.
  • FALSE: Rising edge not detected.
    • The instruction does not execute.
    • The outputs are not updated except Error, ErrorID, EnableOut and Done are set to 0.
In
Input
REAL
The analog signal input.
Valid = any float
Default = 0.0
InRawMax
Input
REAL
The maximum value attainable by the input to the instruction. If InRawMax<= InRawMin, the instruction sets the appropriate bit in Status and Error. ErrorID are updated. Out updating stops.
Valid = InRawMax > InRawMin
Default =0.0
InRawMin
Input
REAL
The minimum value attainable by the input to the instruction. If InRawMin >= InRawMax, the instruction sets the appropriate bit in Status and Error. ErrorID are updated. Out updating stops.
Valid = InRawMin < InRawMax
Default = 0.0
InEUMax
Input
REAL
The scaled value of the input corresponding to InRawMax.
Valid = any real value
Default = 0.0
InEUMin
Input
REAL
The scaled value of the input corresponding to InRawMin.
Valid = any real value
Default = 0.0
Limiting
Input
BOOL
Limiting selector.
TRUE: Out is limited between InEUMin and InEUMax.
Done
Output
BOOL
Indicates when the operation is completed.
  • TRUE: The operation completed successfully.
  • FALSE: The operation encountered an error condition or Enable is set to FALSE.
EnableOut
Output
BOOL
Indicates if the instruction is enabled. Sets to False if Out overflows.
Out
Output
REAL
Represents the scaled value of the analog input.
MaxAlarm
Output
BOOL
The maximum input alarm indicator.
This value is set to TRUE when Input > InRawMax.
MinAlarm
Output
BOOL
The minimum input alarm indicator.
This value is set to TRUE when Input < InRawMin.
Status
Output
DINT
Status of the Function block.
InstructFault (Status.0).
It will be set when detected the instruction's execution errors. This is not the minor or major controller error. Check the remaining status bits to determine what has occurred.
InRawRangeInv (Status.1)
InRawMin >= InRawMax
Status.3 to Status.31 are reserved for future usage and their value is 0.
Error
Output
BOOL
Indicates the existence of an error condition.
  • TRUE: Operation encountered an error.
  • FALSE: Operation completed successfully or the instruction is not executing.
ErrorID
Output
BOOL
A unique numeric that identifies the error. The errors are defined in the error codes.
Error code
ErrorID Code
Error Description
1
InRawMax<= InRawMin

SCL examples

SCL function block diagram example
SCL function block diagram example
SCL ladder diagram example
SCL ladder diagram example
SCL structured text example
SCL structured text example
Provide Feedback
Have questions or feedback about this documentation? Please submit your feedback here.
Normal