O_SCALE_WARN: Scaled analog output with warnings status
Original instructions
Function description
The function block converts values from the REAL floating point format into 16 bit integer format. The scaling inputs MN and MX predefine the value range for the analog output. MN corresponds to 0 percent and MX to 100 percent of the output range (e.g. -10 ...10 V).
In addition the function block at the WARN_NEG and WARN_POS outputs indicate whether a status warning has occurred in the connected analog output EFB.
EN and ENO can be configured as additional parameters.
Representation in FBD
Representation:
Representation in LD
Representation:
Representation in IL
Representation:
CAL O_SCALE_WARN_Instance (CHANNEL:=OutputChannel,
    MN:=ScalingInput0Percent, X:=FloatingPointValue,
    MX:=ScalingInput100Percent,  WARN_NEG=>UnderflowFlag,
    WARN_POS=>OverflowFlag)
Representation in ST
Representation:
O_SCALE_WARN_Instance (CHANNEL:=OutputChannel,
    MN:=ScalingInput0Percent, X:=FloatingPointValue,
    MX:=ScalingInput100Percent,  WARN_NEG=>UnderflowFlag,
    WARN_POS=>OverflowFlag) ;
Parameter description
Description of input parameters:
Parameter
Data type
Meaning
CHANNEL
Output channel
MN
Scaling input, 0 percent
X
REAL
Floating-point value
MX
REAL
Scaling input, 100 percent
Description of output parameters:
Parameter
Data type
Meaning
WARN_NEG
0: no output value underflow at the closed analog output EFB
1: output value underflow at the closed analog output EFB
X < MN
WARN_POS
BOOL
0: no output value overflow at the closed analog output EFB
1: output value overflow at the closed analog output EFB
X > MX
Runtime error
An error message is returned
NOTE: For a list of all block error codes and values, seeAnalog I/O Scaling .