intToHex (Function)

Top  Previous  Next

Architecture:

X32 / NX32 / NX32L

Device support:

ALL

Firmware version:

5.08 / 1.52.00


intToHex will convert a number (INT) to a hex-string.

 

Input:

v : INT

Number to convert.

 

Returns: STRING

A string containing the hexadecimal representation of v.

 

Declaration:

FUNCTION intToHex : STRING;
VAR_INPUT
  v : INT;
END_VAR;

 

Example:

INCLUDE rtcu.inc
 
VAR
  result : STRING;
END_VAR;
 
PROGRAM test;
 
BEGIN
  ...
result := intToHex(v:=256);
  // result will contain "0100" after the call
  ...
END;
 
END_PROGRAM;