Mitsubishi Electric MELSEC FX3U Programming Manual page 667

Melsec fx series programmable logic controllers
Table of Contents

Advertisement

FX
/FX
/FX
Series Programmable Controllers
3G
3U
3UC
Programming Manual - Basic & Applied Instruction Edition
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 code, the length of 1 character is regarded as 2
characters.
• 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
K6706)
• When the value specified by
K6706)
• When the number of characters specified by
device range specified by
• When the number of devices after a device number specified by
devices required to store extracted characters as many as the number specified by
"00H" cannot be stored after all character strings and the last character) (error code: K6706)
• When
specifies a negative value (error code: K6706)
S
2
• When
+1 specifies "-2" or less (error code: K6706)
S
2
• When
+1 specifies a number larger than the number of characters specified by
S
2
(error code: K6706)
Program example
In the program example shown below, four characters are extracted from the 3rd character from the left end
of the character string data stored in D10 and later, and then stored to D0 and later when X000 turns ON.
X000
b15---------------------b8
D10
41H(A)
D11
31H(1)
D12
46H(E)
00H
D13
Four characters
starting from 3rd character
R0
3
4
R1
+1 exceeds the number of characters specified by
S
2
(error code: K6706)
D
FNC206
D10
D0
MIDRP
3rd character
b7-----------------------b0
42H(B)
32H(2)
33H(3)
45H(D)
"BA213ED"
Extracted characters
26 Character String Control – FNC200 to FNC209
26.7 FNC206 – MIDR / Random Selection of Character Strings
+1 from the position specified by
S
2
is smaller than the number of
D
R0
END
b15----------------------b8b7-----------------------b0
D0
31H(1)
D1
46H(E)
D2
"213E"
(error code:
S
1
(error code:
S
1
exceeds the
D
+1 (that is, when
S
2
S
1
32H(2)
33H(3)
0000H
665
21
22
23
24
25
26
27
28
29
30

Advertisement

Table of Contents
loading

This manual is also suitable for:

Melsec fx3ucMelsec fx3g

Table of Contents