hexToDint (Function)

Top  Previous  Next

Architecture:

X32 / NX32 / NX32L

Device support:

ALL

Firmware version:

5.08 / 1.52.00


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

 

 

Input:

hex : STRING

String to convert.

 

Returns: DINT

The value of the string.

 

Declaration:

FUNCTION hexToDint : DINT;
VAR_INPUT
  hex : STRING;
END_VAR;

 

Example:

INCLUDE rtcu.inc
 
VAR
  result : DINT;
END_VAR;
 
PROGRAM test;
 
BEGIN
  ...
 result := hexToDint(hex:="10000");
  // result will contain 65536 after the call
  ...
END;
 
END_PROGRAM;