21 ascii conversion instruction (ascii) – Yaskawa Ladder Works Programming Manual User Manual

Page 51

Advertising
background image

2.21 ASCII CONVERSION Instruction ( ASCII )

2-34

2.21 ASCII CONVERSION Instruction (ASCII)

[Outline]

The ASCII instruction converts the specified characters (character string in Source) to the
corresponding ASCII character codes and stores them in the designated Dest. It recognizes uppercase
and lowercase characters separately.
The first character is stored in the lower-place byte of the first word and the second character is stored
in the higher-place byte of the first word. Other characters are stored in the same way. If the number
of characters is odd, the higher-place byte of the last word in the storage register is set to 0. Up to 32
characters can be entered.

[Format]

Symbol : ASCII
Full Name : Convert Character to ASCII
Category : MATH

Icon :

[Parameter]

Parameter Name

Setting

Source ·

ASCII

characters

Dest

· Any integer type register (except for # and C register)
· Any integer type register with subscript (except for # and C register)

[Program Example]

The character string "ABCD" is stored in MW00100 to MW00101.

MW00100

MW00101

Upper

Lower

MW00100 = 4241H

MW00101 = 4443H

42H ('B')

44H ('D')

41H ('A')

43H ('C')

The character string "ABCDEFG" is stored in MW00100 to MW00103.

MW00100

MW00101

Upper

Lower

MW00102

MW00103

"0" is entered in the extra byte.

MW00100 = 4241H

MW00101 = 4443H

MW00100 = 4645H

MW00101 = 0047H

42H ('B')

44H ('D')

46H ('F')

00H

41H ('A')

43H ('C')

45H ('E')

47H ('G')

Advertising