Date and time in binary format to DATE_AND_TIME
DTBIN_TO_DT converts a value of the data type DTBIN to a value of the data type DATE_AND_TIME.
Input
date and time in binary format
Output
date and time
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
bStart: BOOL:=FALSE;
DT_value: DATE_AND_TIME;
DTBIN_value: DTBIN:=Year := 13,
Month := 10,
Day := 10,
Hour := 12,
Min := 00,
Sec := 00;
END_VAR
When the variable bStart is set to TRUE, the function is carried out.
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_F,E_DTBIN_TO_DT!,,10,1,18,5,,?DEN?D?AENO?C);
B(B_VARIN,,DTBIN_value,8,3,10,5,);
B(B_VAROUT,,DT_value,18,3,20,5,);
B(B_CONTACT,,bStart,3,2,5,4,);
L(1,3,3,3);
L(5,3,10,3);
L(1,0,1,5);
END_NETWORK_BODY
END_NET_WORK
END_BODY
IF bStart then
DT_value := DTBIN_TO_DT(DTBIN_value);
END_IF;