Scale (SCL)

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 Scale (SCL) instruction converts an unscaled input value to a floating point value in engineering units.
Available Languages
Ladder Diagram
This instruction is not available in ladder diagram logic.
Function Block
SCL_FB_avail_v31
Structured Text
SCL(SCL_tag)
Operands
Function Block
Operand
Type
Format
Description
SCL tag
SCALE
Structure
SCL structure
Structured Text
Operand
Type
Format
Description
SCL tag
SCALE
Structure
SCL structure
See
Structured Text Syntax
for more information on the syntax of expressions within structured text.
SCALE 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
InRawMax
REAL
The maximum value attainable by the input to the instruction. If InRawMax Less than or equal to InRawMin, the instruction sets the appropriate bit in Status and stops updating the output.
Valid = InRawMax > InRawMin
Default = 0.0
InRawMin
REAL
The minimum value attainable by the input to the instruction. If InRawMin Greater than or equal to InRawMax, the instruction sets the appropriate bit in Status and stops updating the output.
Valid = InRawMin < InRawMax
Default = 0.0
InEUMax
REAL
The scaled value of the input corresponding to InRawMax.
Valid = any real value
Default = 0.0
InEUMin
REAL
The scaled value of the input corresponding to InRawMin.
Valid = any real value
Default = 0.0
Limiting
BOOL
Limiting selector. If true, Out is limited to between InEUMin and InEUMax.
Default is false.
Output Parameter
Data Type
Description
EnableOut
BOOL
Indicates if instruction is enabled. Cleared to false if Out overflows.
Out
REAL
The output that represents scaled value of the analog input.
Valid = any real value
Default = InEUMin
MaxAlarm
BOOL
The above maximum input alarm indicator. This value is set to true when In> InRawMax.
MinAlarm
BOOL
The below minimum input alarm indicator. This value is set to true when In < InRawMin.
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.
InRawRangeInv (Status.1)
BOOL
InRawMin Greater than or equal to InRawMax.
Description
Use the SCL instruction with analog input modules that do not support scaling to a full resolution floating point value.
For example, the 1771-IFE module is a 12-bit analog input module that supports scaling only in integer values. If you use a 1771-IFE module to read a flow of 0-100 gallons per minute (gpm), you typically do not scale the module from 0-100 because that limits the resolution of the module. Instead, use the SCL instruction and configure the module to return an unscaled (0-4095) value, which the SCL instruction converts to 0-100 gpm (floating point) without a loss of resolution. This scaled value could then be used as an input to other instructions.
The SCL instruction uses this algorithm to convert unscaled input into a scaled value:
SCL instruction algorithm
Alarming
Once the instruction calculates Out, the MaxAlarm and MinAlarm are determined as follows:
Scale (SCL) (1)
Limiting
Limiting is performed on Out when Limiting is set. The instruction sets Out = InEUMax when In > InRawMax. The instruction sets Out = InEUMin when In < InRawMin.
212350
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
EnableIn and EnableOut bits are cleared to false.
Tag.EnableIn is false
EnableIn and EnableOut bits are cleared to false.
Tag.EnableIn is true
EnableIn and EnableOut bits are set to true
The instruction executes.
Instruction first run
N/A
Instruction first scan
N/A
Postscan
EnableIn and EnableOut bits are cleared to false.
Structured Text
Condition/State
Action Taken
Prescan
See Prescan in the Function Block table.
Normal Execution
See Tag.EnableIn is true in the Function Block table.
Postscan
See Postscan in the Function Block table.
Example
The SCL instruction is typically used with analog input modules that do not support on-board scaling to floating point engineering units. In this example, the SCL instruction scales an analog input from a 1771-IFE module. The instruction places the result in Out, which is used by an ALM instruction.
Function Block
SCL_FB_ex_v31
Structured Text
SCL_01.In := Input0From1771IFE;
SCL(SCL_01);
ALM_01.In := SCL_01.Out;
ALM(ALM_01);
Provide Feedback
Have questions or feedback about this documentation? Please submit your feedback here.