hexToInt (Function)

Top  Previous  Next

Architecture:

X32 / NX32 / NX32L

Device support:

ALL

Firmware version:

5.08 / 1.52.00


hexToInt will convert a hex string to a number (INT). If the conversion is not possible, hexToInt will return 0.

 

Input:

hex : STRING

String to convert.

 

Returns: INT

The value of the string.

 

Declaration:

FUNCTION hexToInt : INT;
VAR_INPUT
  hex : STRING;
END_VAR;

 

Example:

INCLUDE rtcu.inc
 
VAR
  result : INT;
END_VAR;
 
PROGRAM test;
 
BEGIN
  ...
result := hexToInt(hex:="100");
  // result will contain 256 after the call
  ...
END;
 
END_PROGRAM;