Character to code CHAR → CODE
Dest = the character's code, like "A" → 65.
Source'A'
To
Dest65
| Tag | After two scans |
|---|---|
| Letter | 'A' |
| LetterCode | 65 |
How it's used
Use it to check a character, such as whether a key is a digit.
Source'7'
To
Dest55
LIM
Low48TestGlobal.KeyCode55High57
Global.IsDigitOTE
| Tag | Value |
|---|---|
| Key | '7' |
| KeyCode | 55 |
| IsDigit | 1 |
Digits are codes 48 to 57. 7 is 55, so IsDigit is on.
Operands
| Operand | Data type | Read or write |
|---|---|---|
| Source | CHAR or a number | Reads |
| Dest | DINT | Writes |
Common mistakes
- Expecting the digit's valueThe character 7 gives its code, 55, not 7.