Mitsubishi Electric FX3G SERIES Programming Manual page 633

Programmable controllers
Hide thumbs Also See for FX3G SERIES:
Table of Contents

Advertisement

FX
/FX
/FX
Series Programmable Controllers
3G
3U
3UC
Programming Manual - Basic & Applied Instruction Edition
In the case of "n = 7"
b15----------------------b8b7----------------------b0
S
42H(B)
S
+1
44H(D)
S
+2
46H(F)
S
+3
32H(2)
S
+4
34H(4)
S
+5
• A character string stored in
first detected in byte units.
Cautions
When handling character codes other than ASCII codes, note the following contents:
• The number of characters is handled in byte units (8 bits). Accordingly, in the case of character codes in which 2
bytes express 1 character such as shift JIS codes, the length of 1 character is detected as "2".
• When extracting characters from a character string including character codes in which 2 bytes express 1 character
such as shift JIS codes, consider the number of characters to be extracted in units of character codes for 1
character.
Note that the expected character code is not given if only 1 byte is executed out of a 2-byte character code.
Errors
An operation error is caused in the following cases; The error flag M8067 turns ON, and the error code is stored in
D8067.
• When "00H" is not set within the corresponding device range after a device specified by
• When "n" exceeds the number of characters specified by
• When the number of devices after a device number specified by
required to store extracted "n" characters (that is, when "00H" cannot be stored after all character strings and the
last character) (error code: K6706)
• When "n" is a negative value (error code: K6706)
Program example
In the program example shown below, the number of characters which is equivalent to the number stored in D0 are
extracted from the left end of the character string data stored in D100 and later, and stored to R10 and later when
X010 turns ON.
X010
b15----------------------b8b7-----------------------b0
D100
51H(Q)
D101
4EH(N)
D102
44H(D)
D103
42H(B)
D104
ASCII code for 6th character
41H(A)
43H(C)
45H(E)
31H(1)
33H(3)
00H
35H(5)
"ABCDEF12345"
S
and later indicates data stored in devices from the specified device until "00H" is
FNC205
D100
R10
LEFTP
53H(S)
4FH(O)
48H(H)
41H(A)
00H
"SQONHDAB"
26 Character String Control – FNC200 to FNC209
26.6 FNC205 – LEFT / Extracting Character String Data from the Left
ASCII code for 1st character
b15----------------------b8b7-----------------------b0
D
42H(B)
D
+1
44H(D)
D
+2
46H(F)
D
+3
ASCII code for 7th character
(error code: K6706)
S
D
is smaller than the number of devices
D0
END
ASCII code for 1st character
b15----------------------b8b7-----------------------b0
R10
51H(Q)
R11
4EH(N)
R12
44H(D)
R13
D0
6
41H(A)
43H(C)
45H(E)
00H
31H(1)
"ABCDEF1"
S
(error code: K6706)
53H(S)
4FH(O)
48H(H)
0000H
"SQONHD"
21
22
23
24
25
26
27
28
29
30
631

Advertisement

Table of Contents
loading

This manual is also suitable for:

Fx3u seriesFx3uc series

Table of Contents