Navigation:  Equipments (Devices) > SCA06 > Ladder > Conversion > REAL >

BYTE_TO_REAL

Previous pageReturn to chapter overviewNext page

Block that performs the conversion of a BYTE value into a REAL value.

 

Ladder Representation

 

BYTE_TO_REAL_block

 

Block Structure

 

Variable Type

Name

Data Type

Description

VAR_INPUT

EN

BOOL

Block enabling

Value

BYTE USINT SINT

Value in BYTE

VAR_OUTPUT

ENO

BOOL

End of operation

Result

REAL

Value in REAL

 

Operation

 

When this block has a TRUE value in EN, it interprets the Value value as BYTE and converts it into REAL, storing in Result.

 

When EN has FALSE value, Result remains unchanged.

 

The ENO value forwards to the next Ladder block the EN value after the operation is completed.

 

Block Flowchart

 

BYTE_TO_REAL_flowchart

 

Example in Ladder

 

BYTE_TO_REAL_example01

 

BYTE_TO_REAL_example02

 

The examples above perform the conversion of variable VALUE, in BYTE, into a REAL value storing the final result in RESULT. The block ends with success and ENO output is activated.

 

Example in ST

 

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

 

 

VAR

   VALUE : SINT := -50;

   RESULT : REAL;

END_VAR

 

RESULT := FB_BYTE_TO_REAL(EN:=DI1, Value:=VALUE, ENO=>DO1);