Navigation:  Equipments (Devices) > SCA06 > Ladder > Math > Math Util >

SAT

Previous pageReturn to chapter overviewNext page

Block that performs a routine for saturation of the value found in Value in accordance with the limits for Minimum and Maximum, storing the result in Result.

 

Ladder Representation

 

SAT_block

 

Block Structure

 

Variable Type

Name

Data Type

Description

VAR_INPUT

EN

BOOL

Block enabling

Value

BYTE USINT SINT WORD UINT INT DWORD UDINT DINT REAL LREAL

Reference value

Minimum

BYTE USINT SINT WORD UINT INT DWORD UDINT DINT REAL LREAL

Inferior saturation value

Maximum

BYTE USINT SINT WORD UINT INT DWORD UDINT DINT REAL LREAL

Superior saturation value

VAR_OUTPUT

Q

BOOL

Indicator that there was saturation in the process

Result

BYTE USINT SINT WORD UINT INT DWORD UDINT DINT REAL LREAL

Result of operation

 

Operation

 

When this block has a TRUE value in EN, it performs a comparison between Value and Minimum and Maximum. If Value is in the range between Minimum and Maximum, Result receives the value of Value and Q remains FALSE. If Value is higher than Maximum, Result receives Maximum and Q receives TRUE. If Value is lower than Minimum, Result receives Minimum and Q receives TRUE. If there is any error in the operation, Q is not set, staying in FALSE status, while Result remains with its value unchanged.

 

When EN has FALSE value, Result remains unchanged and Q remains in FALSE.

 

Block Flowchart

 

SAT_flowchart

 

Example in Ladder

 

SAT_example01

 

The above example passes the VALUE value to RESULT, since it is not lower than MINIMUM or higher than MAXIMUM. The block ends successfully and the Q output is disabled, since there was no saturation.

 

SAT_example02

 

The above example passes the MAXIMUM to RESULT, since VALUE is higher than MAXIMUM. The block ends successfully and the Q output is activated, since there was saturation.

 

SAT_example03

 

The above example passes the MINIMUM to RESULT, since VALUE is lower than MINIMUM. The block ends successfully and the Q output is activated, since there was saturation.

 

SAT_example04

 

The above example passes the MAXIMUM value to RESULT, since VALUE is higher than MAXIMUM. The block ends successfully and the Q output is activated, since there was saturation.

 

Example in ST

 

 The example below displays the instructions for applying the example above in the ST language.

 

 

VAR

   VALUE : INT := 700;

   MINIMUM : INT := 300;

   MAXIMUM : INT := 500;

   RESULT : INT;

END_VAR

 

RESULT := FB_SAT(

   EN:=DI1,

   Value:=VALUE,

   Minimum:=MINIMUM,

   Maximum:=MAXIMUM,

  Q=>DO1);