Control codes - converting to ASCII, Hex or Decimal
Our free ComDebug software lets you both collect data from, and control, measurement instruments which are connected to your computer.
Sometimes you need to send a control command to instruct the instrument to send back its data. In ComDebug you can enter these commands in either decimal or hexadecimal format.
Converting Control Codes to ASCII, Decimal and Hexadecimal
Ctrl | ASCII | Dec | Hex | Meaning |
---|---|---|---|---|
^@ | NUL | 000 | 00 | Null character |
^A | SOH | 001 | 01 | Start of Header |
^B | STX | 002 | 02 | Start of Text |
^C | ETX | 003 | 03 | End of Text |
^D | EOT | 004 | 04 | End of Transmission |
^E | ENQ | 005 | 05 | Enquiry |
^F | ACK | 006 | 06 | Acknowledge |
^G | BEL | 007 | 07 | Bell |
^H | BS | 008 | 08 | Backspace |
^I | HT | 009 | 09 | Horizontal tab |
^J | LF | 010 | 0A | Line feed |
^K | VT | 011 | 0B | Vertical tab |
^L | FF | 012 | 0C | Form feed |
^M | CR | 013 | 0D | Carriage return |
^N | SO | 014 | 0E | Shift out |
^O | SI | 015 | 0F | Shift in |
^P | DLE | 016 | 10 | Data link escape |
^Q | DCL | 017 | 11 | Xon (transmit on) |
^R | DC2 | 018 | 12 | Device control 2 |
^S | DC3 | 019 | 13 | Xoff (transmit off) |
^T | DC4 | 020 | 14 | Device control 4 |
^U | NAK | 021 | 15 | Negative acknowledge |
^V | SYN | 022 | 16 | Synchronous idle |
^W | ETB | 023 | 17 | End of transmission |
^X | CAN | 024 | 18 | Cancel |
^Y | EM | 025 | 19 | End of medium |
^Z | SUB | 026 | 1A | Substitute |
^[ | ESC | 027 | 1B | Escape |
^\ | FS | 028 | 1C | File separator |
^] | GS | 029 | 1D | Group separator |
^^ | RS | 030 | 1E | Record separator |
^_ | US | 031 | 1F | Unit separator |
SP | 032 | 20 | Space |
The ^ symbol stands for Ctrl
Originally the Control codes were used for instruments like teleprinters, so many of the codes are now obsolete.
Entering Control Codes with Comdebug
- Create a new instrument file
- Edit Message_1
- Type into the Prompt string box. Either
- On your keyboard set Num Lock on and use the numeric keypad to type the decimal equivalent of the Control character into the Char column, or
- Type the hexadecimal equivalent straight into the Hex column.
Carriage Return, Line Feed and Escape are the three that you will most often come across. (There are shortcuts for these on ComDebug's non-print menu.) Also look out for STX and ETX which are used to mark the start and end of messages from instruments.