hexToSint (Function)

Top  Previous  Next

Architecture:

X32 / NX32 / NX32L

Device support:

ALL

Firmware version:

5.08 / 1.52.00


hexToSint will convert a string to a number (SINT). If the conversion is not possible, hexToSint will return 0.

 

Input:

hex : STRING

String to convert.

 

Returns: SINT

The value of the string.

 

Declaration:

FUNCTION hexToSint : SINT;
VAR_INPUT
  hex : STRING;
END_VAR;

 

Example:

INCLUDE rtcu.inc
 
VAR
  result : SINT;
END_VAR;
 
PROGRAM test;
 
BEGIN
  ...
 result := hexToSint(hex:="80");
  // result will contain -128 after the call
  ...
END;
 
END_PROGRAM;