GET_USINT

Read an unsigned integer value from byte data with offset

This function gets the 8-bit byte value of Data with iByteOffset denoting the offset in byte. The byte numbering starts from 0, which refers to the first byte of Data.

The result contains the unsigned integer value in the range from 0 to 255, the upper bytes of the result are filled with zeros.

Input

Data (ANY) all simple and derived data types (ARRAYs, DUTs) which do not contain BOOL data

Byte data from which the byte is got

iByteOffset (INT, DINT, UINT, UDINT)

Byte offset relative to the first byte of Data starting from 0, must be greater than or equal to 0

Output

Unnamed output (INT, DINT, UINT, UDINT)

Unsigned integer value in the range from 0 to 255, the upper bytes filled with zeros

Remarks

  • Please check the validity of the input data since Control FPWIN Pro7 does not check the validity of the data to access.

NOTE

To get the best performance please use constant input values as much as possible!

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
		bStart: BOOL:=FALSE;
		awByteData: ARRAY [0..4] OF INT:=[100,200,300,-400,501];
		iOffs: INT:=4;
	END_VAR

LD body

When the variable bStart is set to TRUE, the function is carried out.

BODY
    WORKSPACE
        NETWORK_LIST_TYPE := NWTYPELD ;
    END_WORKSPACE
    NET_WORK
        NETWORK_TYPE := NWTYPELD ;
        NETWORK_LABEL :=  ;
        NETWORK_TITLE :=  ;
        NETWORK_HEIGHT := 7 ;
        NETWORK_BODY
B(B_CONTACT,,bStart,4,3,6,5,);
B(B_F,E_GET_USINT!,,11,2,19,7,,?DEN?dData?diByteOffset?AENO?c);
B(B_VARIN,,awByteData,9,4,11,6,);
B(B_VAROUT,,iResult,19,4,21,6,);
B(B_VARIN,,iOffs,9,5,11,7,);
L(1,0,1,7);
L(1,4,4,4);
L(6,4,11,4);
        END_NETWORK_BODY
    END_NET_WORK
END_BODY

ST body

if (bSTart) then
	GET_USINT(Data := awByteData, iByteOffset := iOffs);
end_if;

Modified on: 2025-03-06Feedback on this pagePanasonic hotline