ASCII code for PLC programming What is ASCII code

Currently ComputersThe most widely used character set and its encoding is the ASCII code (American Standard Code for Information Interchange) formulated by the American National Institute of Standards (ANSI) , the American Standard Code for Information Interchange), which has been designated as an international standard by the International Organization for Standardization (ISO), known as the ISO 646 standard. Applicable to all Latin letters, ASCII code has two forms of 7-bit code and 8-bit code.
Because a 1-bit binary number can represent (21=) 2 states: 0, 1; and a 2-bit binary number can represent (22) = 4 states: 00, 01, 10, 11; and so on, 7 bits Binary numbers can represent (27=) 128 states, and each state is uniquely encoded as a 7-bit binary code, corresponding to a character (or control code), and these codes can be arranged into a decimal number 0~127. Therefore, the 7-bit ASCII code is encoded with seven binary numbers, which can represent 128 characters.
No. 0~32 and No. 127 (34 in total) are control characters or special communication characters, such as control characters: LF (line feed), CR (carriage return), FF (page feed), DEL (delete) , BS (backspace), BEL (ringing), etc.; special characters for communication: SOH (head of text), EOT (end of text), ACK (confirmation), etc.;
No. 33 to 126 (94 in total) are Characters, of which No. 48 to 57 are ten Arabic numerals from 0 to 9; No. 65 to 90 are 26 uppercase English letters, No. 97 to 122 are 26 lowercase English letters, and the rest are some punctuation marks, operation symbols, etc.
Note: In the storage unit of the computer, an ASCII code value occupies a byte (8 binary bits), and its highest bit (b7) is used as a parity bit. The so-called parity check refers to a method used to check whether there is an error in the code transmission process, generally divided into two types: odd check and even check. Odd check rule: the number of 1s in a byte of the correct code must be an odd number, if it is not an odd number, add 1 to the highest bit b7; even check rule: the number of 1s in a byte of the correct code must be an even number , if it is not an even number, add 1 to the highest bit b7.

Leave a Reply

Your email address will not be published. Required fields are marked *