Mitsubishi — 3.14.3.4 Data Conversion

Chapter 3 Creating and Editing Screens  TOBYTE (Convert WORD to BYTE) Equation Var1 = TOWORD (Var2, Var3) Explanation Convert Var3 number of WORD data from low-byte of Var2 to BYTE format and store the result in Var1. This will discard high-byte of Var2. Remark  The calculation result can be stored as unsigned WORD.  Var1 and Var2 can be internal memory only. Var3 can be internal memory or constant.  After data conversion is completed, the low and high bit of the converted WORD data will be exchanged.

Example Assume that the value of $0 is 12, this will convert 12 WORDS starting from the low-byte of $4 and convert these 12 WORDS into 12 BYTES (6 WORDS) and store the result in $10 to $16 (this is an operation of unsigned 16-bit data). 3-336 Revision May, 2010