Mitsubishi — 3.14.3.4 Data Conversion

Chapter 3 Creating and Editing Screens  TOHEX (Convert 4 ASCII Code to a Four-Digit Integer in Hexadecimal Format) Equation Var1 = TOHEX (Var2) Explanation Convert a single ASCII code of Var2 and the next 3 words (4 WORDS) to a hex value and stores the result in Var1. Remark  The calculation result can be stored as unsigned WORD.  Var1 and Var2 can be internal memory only. Example Convert a single ASCII code of $0 and the next 3 words (4 WORDS) to a hex value and stores the result in $10 (this is an operation of unsigned 16-bit data).

$0 = 0034H (ASCII 4), $1 = 0033H (ASCII 3), $2 = 0036H (ASCII 6), $3 = 0038H (ASCII 8), $10 = TOHEX ($0) After executing TOHEX command, the data in $10 will be converted to 4368H. 3-340 Revision May, 2010