FC_ScaleAnalogOutput

 

FC_ScaleAnalogOutput - General Information

Overview

Type:

Function

Available as of:

V1.0.0.0

Versions:

Current version

This chapter provides information on:

oTask

oDescription

oInterface

oReturn Value

oDiagnostic Messages

Task

Scale a value in a configured range to an analog output value.

Description

The function FC_ScaleAnalogOutput() takes the value transferred at input i_lrValue within the range described by i_lrMinValue and i_lrMaxValue and scales it into an analog output value.

The result acts as return value of the function.

Interface

Input

Data type

Description

i_lrValue

LREAL

Value to be scaled.

i_lrMinValue

LREAL

Minimum of the input value.

i_lrMaxValue

LREAL

Maximum of the input value.

Output

Data type

Description

q_etDiag

GD.ET_Diag

General library-independent statement on the diagnostic.

A value unequal to GD.ET_Diag.Ok corresponds to a diagnostic message.

q_etDiagExt

ET_DiagExt

POU-specific output on the diagnostic.

q_etDiag = GD.ET_Diag.Ok -> Status message

q_etDiag <> GD.ET_Diag.Ok -> Diagnostic message

Return Value

Data type

Description

WORD

Result of the scaling.

Diagnostic Messages

q_etDiag

q_etDiagExt

Enumeration value

Description

OK

Ok

0

Ok

InputParameterInvalid

ValueRange

8

An input value is out of range.

UnexpectedProgramBehavior

UnexpectedFeedback

5

A feedback value is invalid.

Ok

Enumeration name:

Ok

Enumeration value:

0

Description:

Ok

The scaling was successful.

UnexpectedFeedback

Enumeration name:

UnexpectedFeedback

Enumeration value:

5

Description:

A feedback value is invalid.

The scaling was unsuccessful.

ValueRange

Enumeration name:

ValueRange

Enumeration value:

8

Description:

A feedback value is invalid.

Issue

Cause

Solution

The scaling was unsuccessful.

The value transferred at input i_lrMinValue is greater than the value transferred at input i_lrMaxValue.

Ensure that the value transferred at input i_lrMinValue is less than the value transferred at input i_lrMaxValue.

The value transferred at input i_lrValue is outside the range defined by i_lrMinValue and i_lrMaxValue.

Ensure that the value transferred at input i_lrValue is within the defined range.