3. Instruction Set

API

Mnemonic

Operands

Function

Controllers

76

ASC

 

ASCII code conversion

ES2/EX2

SS2

SA2 SX2

 

 

 

SE

Type

Bit Devices

 

Word devices

 

 

 

 

Program Steps

OP

X

Y

M

S

K

H KnX KnY KnM KnS T

C

D

E

F

ASC: 11 steps

S

 

 

 

 

 

 

 

 

 

 

 

D

 

 

 

 

 

*

*

*

 

 

 

 

 

 

 

 

 

PULSE

 

 

16-bit

 

32-bit

 

ES2/EX2

SS2

SA2

 

SX2

ES2/EX2

SS2

SA2

SX2

ES2/EX2

SS2

SA2

SX2

 

SE

 

SE

SE

Operands:

 

 

 

 

 

 

 

 

 

 

 

S: English letters to be converted into ASCII code

D: Device for storing ASCII code

 

 

Explanation:

1.The ASC instruction converts 8 English letters stored in S and save the converted ASCII code in D. The value in S can be input by WPLSoft or ISPSoft.

2.If PLC is connected to a 7-segment display while executing ASC instruction, the error message can be displayed by English letters

3.Flag: M1161 (8/16 bit mode switch)

Program Example:

When X0 = ON, A~H is converted to ASCII code and stored in D0~D3.

X0

ASC A B C D E F G H D0

When M1161 = ON, every ASCII code converted from the letters will occupy the lower 8 bits (b7 ~ b0) of a register and the upper 8 bits are invalid (filled by 0), i.e. one register stores a letter

 

b15

 

 

b0

D0

42H

(B)

41H (A)

D1

44H

(D)

43H (C)

D2

46H

(F)

45H (E)

D3

48H

(H)

47H (G)

 

High byte

Low byte

 

b15

 

 

b0

D0

00 H

41H

(A)

D1

00 H

42H

(B)

D2

00 H

43H

(C)

D3

00 H

44H

(D)

D4

00 H

45H

(E)

D5

00 H

46H

(F)

D6

00 H

47H

(G)

D7

00 H

48H

(H)

 

High byte

Low byte

3 - 1 9 7

Page 313
Image 313
Delta DVP-ES2/EX2/SS2/SA2/SX2/SE manual Ascii code conversion