STRING (decimal format) into unsigned DOUBLE INTEGER
STRING_TO_UDINT converts a string in decimal format into a value of the data type Unsigned DOUBLE INTEGER.
First, the string is converted into a value of the data type STRING[32], which is subsequently converted into a value of the data type UDINT in a subprogram with approximately 270 steps. This subprogram is also used by the functions STRING_TO_INT, STRING_TO_WORD, STRING_TO_UDINT and STRING_TO_DWORD.
Acceptable format: '[Space][Sign][Decimal number][Space]' e.g. ' 123456 '
Acceptable characters:
Space
Space ""
Sign
"+“ (plus), "-" (minus)
Decimal numbers
Decimal numbers "0 - 9“
The analysis ends with the first non-decimal number.
Input
Input data type
Output
Conversion result
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:=0;
STRING_value: STRING[10]:='3147483647';
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_F,STRING_TO_UDINT!,Instance,15,1,25,3,,?D?C);
B(B_VARIN,,STRING_value,13,1,15,3,);
B(B_VAROUT,,UDINT_value,25,1,27,3,);
L(1,0,1,5);
END_NETWORK_BODY
END_NET_WORK
END_BODY
UDINT_value := STRING_TO_UDINT(STRING_value);