UINT_TO_STRING_LEFT_ALIGNED

Unsigned INTEGER into left-aligned STRING

It converts a value of the data type Unsigned INTEGER into a value of the data type STRING in left-aligned decimal representation.

Parameters

Input

Unnamed input (UINT)

Input data type

Output

Unnamed output (STRING)

Conversion result

NOTE
The result is not specified when the range of the input values does not match the range of the output values.

Example

POU header

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
		uiValue: UINT:=49152;
		sResult: STRING[8]:='';
	END_VAR

LD body

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,UINT_TO_STRING_LEFT_ALIGNED!,,12,2,28,4,,?D?C);
B(B_VARIN,,uiValue,10,2,12,4,);
B(B_VAROUT,,sResult,28,2,30,4,);
L(1,0,1,5);
        END_NETWORK_BODY
    END_NET_WORK
END_BODY

ST body

sResult:=  UINT_TO_STRING_LEFT_ALIGNED(uiValue);

Modified on: 2019-01-24Feedback on this pagePanasonic hotline