Function BlockFB_ScaleOutput

Description

Scale LREAL to DINT .

This Kollmorgen UDFBClosed"User Defined Function Block" UDFB can be used as a sub-function block in another program of the application. It is described using FBD, LD, ST or IL language. Input / output parameters of a UDFB (as well as private variables) are declared in the variable editor as local variables of the UDFB 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 that 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, and the OutputSignal is set to the corresponding OutputMin or OutputMax value.

The following figure shows the function block I/O:

UDFB ScaleOutput

Figure 8-227: Scale Output

 

Arguments

Input

InputSignal

Description

Un-scaled input signal

 

Data type

LREAL

 

Range

[0 , 4]

 

Unit

N/A

 

Default

InputMin

Description

Minimum value of accepted input signal range

 

Data type

LREAL

 

Range

[0 , 4]

 

Unit

N/A

 

Default

InputMax

Description

Maximum value of accepted input signal range

 

Data type

LREAL

 

Range

[0 , 4]

 

Unit

N/A

 

Default

OutputMin

Description

Output value mapped to the InputMin

 

Data type

DINT

 

Range

[0 , 4]

 

Unit

N/A

 

Default

OutputMax

Description

Output value mapped to the InputMax

 

Data type

DINT

 

Range

[0 , 4]

 

Unit

N/A

 

Default

Output

OutputSignal

Description

Scaled value of the Input Signal with type converted to DINT. Stays within specified Min/Max output values

 

Data type

DINT

 

Unit

N/A

OutsideRange

Description

True if InputSignal is outside range setup by min/max values, otherwise FALSE

 

Data type

BOOL

 

Unit

N/A

Usage

Scale an analog signal to a drive.

Related Functions

UDFB ScaleInput

Example

Structured Text

 

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;

 

Ladder Diagram

UDFB ScaleOutput: LD example

 

Function Block Diagram

UDFB ScaleOutput: FBD example

 

Go back to the top of the page [Top]