Blocks Hexstrings

From IPLOG
Revision as of 07:36, 30 April 2020 by Z033 (talk | contribs) (Created page with "== Back to Libraries == === Hexstrings === ==== HEXCHAR_TO_NIBBLE ==== Returns a BYTE number between 0 and 15 by converting the ASCII code given...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Back to Libraries

Hexstrings

HEXCHAR_TO_NIBBLE

Returns a BYTE number between 0 and 15 by converting the ASCII code given to the block input. If a code other than the characters '0' ... '9', 'A' ... 'F', 'a' ... 'f' is input, it returns 0.

in IN byte input value ASCII code
out byte byte value 0 ... 15

HEXSTRING_TO_INT

Returns an int number by converting a 4-character input string containing a 16-bit hexadecimal representation. If a character other than '0' ... '9', 'A' ... 'F', 'a' ... 'f' is entered at the input, it will be converted to 0. For example, entering the string "00Ff" will return 255, and passing "00FG" will return 240.

in IN string[4] input value 4 hexadecimal characters
out int int value

HEXSTRING_TO_SINT

Returns an signed short integer number by converting a 2-character input string containing a 8-bit hexadecimal representation. If a character other than '0' ... '9', 'A' ... 'F', 'a' ... 'f' is entered at the input, it will be converted to 0. For example, entering the string "Ff" will return -1, and passing "FG" will return -16.

in IN string[2] input value 2 hexadecimal characters
out sint sint value

HEXSTRING_TO_USINT

Returns an unsigned short integer number by converting a 2-character input string containing a 8-bit hexadecimal representation. If a character other than '0' ... '9', 'A' ... 'F', 'a' ... 'f' is entered at the input, it will be converted to 0. For example, entering the string "Ff" will return 255, and passing "FG" will return 240.

in IN string[2] input value 2 hexadecimal characters
out usint usint value

HEXSTRING_TO_UINT

Returns an unsigned integer number by converting a 4-character input string containing a 16-bit hexadecimal representation. If a character other than '0' ... '9', 'A' ... 'F', 'a' ... 'f' is entered at the input, it will be converted to 0. For example, entering the string "FfFf" will return 65535, and passing "KKFF" will return 255.

in IN string[4] input value 4 hexadecimal characters
out uint uint value

INT_TO_HEXSTRING

Returns a 4-character string containing a 16-bit hexadecimal representation of integer input. For example, entering 255 will return "00FF", and passing 256 will return "0100".

in IN int input value int
out string[4] hexadecimal representation of value

NIBBLE_TO_HEXCHAR

Returns a BYTE value containing the ASCII code of the character corresponding to the lower 4 bits of the input value.

in IN byte input value byte
out byte ASCII code of value '0' ... 'F'

SINT_TO_HEXSTRING

Returns a STRING [2] value containing two characters in ASCII codes corresponding to the hexadecimal notation of the input value.

in IN sint input value sint
out string[2] hexadecimal representation of value

UINT_TO_HEXSTRING

Returns a STRING [4] value containing four characters in ASCII codes corresponding to the hexadecimal notation of the input value.

in IN uint input value uint
out string[4] hexadecimal representation of value

USINT_TO_HEXSTRING

Returns a STRING [2] value containing two characters in ASCII codes corresponding to the hexadecimal notation of the input value.

in IN usint input value usint
out string[2] hexadecimal representation of value