Unsigned DOUBLE INTEGER into BCD DOUBLE WORD
UDINT_TO_BCD_DWORD converts a value of the data type Unsigned DOUBLE INTEGER into a BCD value of the data type DWORD.
Input
Output
The value for the input variable should be between 0 and 999,999,999.
All input and output variables used for programming this function have been declared in the POU header. The same POU header is used for all programming languages.
VAR
UDINT_value: UDINT:=4294967295;
BCD_value_32bit: DWORD;
END_VAR
BODY
WORKSPACE
NETWORK_LIST_TYPE := NWTYPELD ;
ACTIVE_NETWORK := 0 ;
END_WORKSPACE
NET_WORK
NETWORK_TYPE := NWTYPELD ;
NETWORK_LABEL := ;
NETWORK_TITLE := ;
NETWORK_HEIGHT := 5 ;
NETWORK_BODY
B(B_VARIN,,UDINT_value,13,1,15,3,);
B(B_VAROUT,,BCD_value_32bit,27,1,29,3,);
B(B_F,UDINT_TO_BCD_DWORD!,Instance,15,1,27,3,,?D?C);
L(1,0,1,5);
END_NETWORK_BODY
END_NET_WORK
END_BODY
BCD_value_32bit := UDINT_TO_BCD_DWORD(UDINT_value);