Skip to main content

BOOL_TO_WORD

The BOOL_TO_WORD block converts a BOOL value to WORD.

Ladder Representation

BOOL_TO_WORD Ladder representation

Block Structure

Variable TypeNameData TypeDescription
VAR_INPUTENBOOLBlock enable.
VAR_INPUTValueBOOLBOOL value.
VAR_OUTPUTENOBOOLEnd of operation.
VAR_OUTPUTResultWORD / UINT / INTWORD value.

Operation

When EN is TRUE, the block interprets Value as a BOOL value, converts it to WORD, and stores the result in Result.

When EN is FALSE, Result remains unchanged.

The ENO output passes the EN state to the next Ladder block after the operation is finished.

Execution Flowchart

BOOL_TO_WORD execution flowchart

Examples

The Ladder examples convert VALUE from BOOL to WORD, store the final value in RESULT, and activate ENO when the block finishes successfully.

BOOL_TO_WORD Ladder example

BOOL_TO_WORD Ladder example result