Block that performs the conversion of two 16 bits (WORD) values into a 32 bits (DWORD) value.
Ladder Representation

Block Structure
Variable Type |
Name |
Data type |
Description |
VAR_INPUT |
EN |
BOOL |
Block enabling |
Value1 |
WORD UINT INT |
1st WORD (Less Significant Word) |
|
Value2 |
WORD UINT INT |
2nd WORD (More Significant Word) |
|
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 Value1 and Value2 values as WORD and converts it into a DWORD variable, 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

Example in Ladder


The examples above perform the conversion of two variable VALUE1 and VALUE2, in WORD, 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 VAL1 : INT := 4; VAL2 : INT := 1; RESULT : DINT; END_VAR
RESULT := FB_WORDS_TO_DWORD( EN:=DI1, Value1:=VAL1, Value2:=VAL2, ENO=>DO1);
|
|---|