← Strings and Text

Byte to Hex Text

medium

Writes a byte as two hex digits, 244 as 'F4' and 10 as '0A'.

What it teaches

A byte holds 0 to 255, and hex writes it as two digits worth 0 to 15 each: the first counts sixteens and the second counts ones, so 244 is 15 sixteens and 4 ones, 15 × 16 + 4. The digits are '0' to '9', then 'A' to 'F' for 10 to 15, so 244 is written 'F4'. As characters they are codes 48 to 57 and 65 to 70. DTOS writes decimal only and gives '244'. Below 16 the first digit is 0 and is still written, 10 as '0A', as the serial number kept its zeros in Serial Number Text.

Parameters

TagDirectionTypeDefaultDescription
In_ValueInputDINT244A byte value, 0 to 255
Ref_HexByteInOutSTRING—In_Value as two hex digits

Required behavior