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

BCD_TO_WORD

Previous pageReturn to chapter overviewNext page

Block that performs the conversion of a BCD code into a WORD value.

 

Ladder Representation

 

BCD_TO_WORD_block

 

Block Structure

 

Variable Type

Name

Data Type

Description

VAR_INPUT

EN

BOOL

Block enabling

Value

WORD UINT INT

Value in BCD

VAR_OUTPUT

ENO

BOOL

End of operation

Result

WORD UINT INT

Value in WORD

 

Operation

 

When this block has a TRUE value in EN, it interprets the Value value as BCD and converts it to WORD, 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

 

BCD_TO_WORD_flowchart

 

Example in Ladder

 

BCD_TO_WORD_example01

 

BCD_TO_WORD_example02

 

The above example converts the VALUE variable, in BCD, into a WORD 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 : WORD := 51;

   RESULT : WORD;

END_VAR

 

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