FB_ScaleOutput - Scaling Analog IO

 Function BlockClosed A function block groups an algorithm and a set of private data. It has inputs and outputs. - Converts un-scaled LREAL values from a PLCClosed "Programmable Logic Controller" A Programmable Logic Controller, PLC, or Programmable Controller is a digital computer used for automation of industrial processes, such as control of machinery on factory assembly lines. Used to synchronize the flow of inputs from (physical) sensors and events with the flow of outputs to actuators and events program into units of type DINT.

Inputs

Input

Data Type

Range

Unit

Default

Description

InputSignal

LREAL

0, 4

N/A

No default

Un-scaled input signal.

InputMin

LREAL

0, 4

N/A

No default

Minimum value of accepted input signal range.

InputMax

LREAL

0, 4

N/A

No default

Maximum value of accepted input signal range.

OutputMin

DINT

0, 4

N/A

No default

Output value mapped to the InputMin.

OutputMax

DINT

0, 4

N/A

No default

Output value mapped to the InputMax.

Outputs

Output

Data Type

Range

Unit

Description

OutputSignal

DINT

 

N/A

Scaled value of the Input Signal with type converted to DINT.

Stays within specified Min/Max output values.

OutsideRange

BOOL

 

N/A

TRUE if the InputSignal is outside the range setup by min/max values, otherwise FALSE.

Remarks

  • The scale LREAL to DINT can be mapped to an analog output.
  • The input signal is converted based on a linear mapping automatically calculated by two points entered.
  • InputMin is mapped to OutputMin, InputMax is mapped to OutputMax, and all values in between are scaled automatically.
  • If an input value is not between the selected Min/Max, the Boolean output OutsideRange turns TRUE.
    • The OutputSignal is set to the corresponding OutputMin or OutputMax value.

This image shows the function or function block I/O.

UDFB ScaleOutput

Figure 6-110: Scale Output

Usage

Scale an analog signal from a drive.

FBD Language Example

UDFB ScaleOutput: FBD example

FFLD Language Example

UDFB ScaleOutput: LD example

IL Language Example

Not available.

ST Language Example

Inst_ScaleOutput1( ScaleOutput_In2, ScaleOutput_In2_Min,ScaleOutput_In2_Max, ScaledOutput_2_Min, ScaledOutput_2_Max );
ScaledOutput_2:=Inst_ScaleOutput1.OutputSignal;
ScaledOutput_2_Err:=Inst_ScaleOutput1.OutsideRange;

See Also

FB_ScaleInput - Scaling Analog IO