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

BOOL_TO_DWORD

Previous pageReturn to chapter overviewNext page

/Block that performs the conversion of a BOOL value into a DWORD value.

 

Ladder Representation

 

BOOL_TO_DWORD_block

 

Block Structure

 

Variable Type

Name

Data Type

Description

VAR_INPUT

EN

BOOL

Block enabling

Value

BOOL

Value in BOOL

VAR_OUTPUT

ENO

BOOL

End of operation

Result

DWORD UDINT DINT

Value in DWORD

 

Operation

 

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

 

BOOL_TO_DWORD_flowchart

 

Example in Ladder

 

BOOL_TO_DWORD_example01

 

BOOL_TO_DWORD_example02

 

The examples above perform the conversion of VALUE variable, in BOOL, into a DWORD 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 : BOOL := FALSE;

   RESULT : DINT;

END_VAR

 

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