Mitsubishi Electric M800VW Series Programming Manual page 369

Plc programming
Hide thumbs Also See for M800VW Series:
Table of Contents

Advertisement

M800V/M80V Series PLC Programming Manual (1/2)
8 Function Instructions
8.10 Character String Processing Instructions
 Operation errors
 In the following cases, an arithmetic error occurs, the error flag (SM0) turns ON, and an error code is stored at SD0.
- The character string designated by (S) is "0" characters. (Error code: 34)
- The value of n exceeds the number of characters designated by (S). (Error code: 82)
- n is a negative number. (Error code: 82)
- The range from (D) to (D) + the number of characters designated in n (including (D)), exceeds the relevant device
range. (Error code: 82)
 Program example
 The following program extracts 4 characters of data from the right of the character string stored in the area starting from R0,
and stores them into the area starting from D0 when X0 turns ON.
X0
0
5
b15
41H (A)
R0
31H (1)
R1
R2
45H (F)
R3
41H (A)
R4
"BA210EFA"
 The following program extracts the number of characters corresponding to the value stored in D0 from the left of the char-
acter string data stored in the area starting from D100, and stores them into the area starting from R10 when X1C turns ON.
X1C
0
5
b15
D100
51H (Q)
4EH (N)
D101
D102
44H (D)
D103
42H (B)
D104
"SQONHDAB"
ASCII code for the 6th
character
IB-1501667-B
[Ladder mode]
RIGHTP R0 D0 K4
END
b8b7
b0
42H (B)
32H (2)
30H (0)
46H (F)
00H
[Ladder mode]
LEFTP D100 R10 D0
END
b8b7
b0
53H (S)
4FH (O)
48H (H)
41H (A)
D0
00H
Steps
0
1
2
5
[Operation]
b15
45H (E)
D0
41H (A)
D1
D2
ASCII code for the 4th
character
Steps
0
1
5
[Operation]
b15
R10
51H (Q)
R11
4EH (N)
R12
44H (D)
R13
6
348
[List mode]
Inst.
Device
LD
X0
RIGHTP
R0
D0
K4
END
b8b7
b0
30H (0)
46H (F)
00H
"0EFA"
[List mode]
Inst.
Device
LD
X1C
LEFTP
D100
R10
D0
END
b8b7
53H (S)
4FH (O)
48H (H)
00H
"SQONHD"
b0

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents