This function converts a decimal number into a hexadecimal string (base 16).
FUNCTION BYTE_TO_HEXSTR: T_MaxString
VAR_INPUT
VAR_INPUT in : BYTE; iPrecision : INT; bLoCase : BOOL := FALSE; END_VAR
in: The decimal number requiring conversion.
iPrecision: Minimum number of displayed digits (digits). If the actual number of significant digits is less than the iPrecision parameter, the resulting string is filled with zeros from the left. If the number of significant digits is greater than the iPrecision parameter, the resulting string is not cut off! If the iPrecision parameter and the in parameter are zero, the resulting string is empty.
bLoCase: This parameter determines whether lower or upper case letters are used in the conversion. FALSE => "ABCDEF", TRUE => "abcdef".
Ticket moved from /prj/tcunit4codesys/tickets/12/
Ticket moved from /prj/csunit/tickets/9/
This function uses PrintF function from IECStringUtils Library. I think its much easier to read then DWORD_TO_HEXSTR.