Mitsubishi Electronics FX3G User Manual

Page of 964
631
FX
3S
/FX
3G
/FX
3GC
/FX
3U
/FX
3UC
 Series
Programming Manual - Basic & Applied Instruction Edition
26 Character String Control – FNC200 to FNC209
26.7 FNC206 – MIDR / Random Selection of Character Strings
21
FNC160
-F
NC1
69
R
eal
 T
ime C
lock
 
C
ontrol
22
FNC17
0-F
NC
179
E
xternal D
evice
23
FNC
180
Alternate 
Instructions
24
FN
C181-
FNC18
9
O
thers
25
FNC190
-F
NC1
99
Bl
oc
k D
ata
 
Op
er
ation
26
FNC20
0-F
NC209
C
har
ac
te
r S
trin
Con
tro
l
27
FNC2
10-
FNC21
9
Dat
Operati
on 3
28
FNC220
-F
NC2
49
Da
ta 
C
omp
ari
son
29
FNC25
0-F
N
C
269
D
ata T
abl
Operation
30
FNC2
70-
FNC276
Ex
-Dev
ice
Explanation of function and operation
1. 16-bit operation (MIDR and MIDRP)
 "
+1" characters are extracted leftward from the position specified by 
 of the character string data stored
in 
 and later, and stored to 
 and later.
When characters are extracted from a character string, "00H" is automatically added at the end of the extracted
characters.
- When the number of extracted characters specified by 
+1 is odd, "00H" is stored in the high-order byte of 
a device storing the last character.
- When the number of extracted characters specified by 
+1 is even, "0000H" is stored in the device after the 
last character.
• A character string stored in 
 and later indicates data stored in devices from the specified device until “00H” is 
first detected in units of byte.
• When the number of characters to be extracted specified by 
+1 is “0”, the extraction processing is not 
executed.
• When the number of characters to be extracted specified by 
+1 is “-1”, the entire character string stored in 
 and later is stored to 
 and later.
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.
  
S
2
  
S
2
  
S
1
   
D
  
S
2
  
S
2
46H(F)
45H(E)
48H(H)
47H(G)
49H(I)
48H(H)
46H(F)
45H(E)
47H(G)
49H(I)
FNC206
MIDR
S
S
5th character
+1
+2
+4
+3
+5
b15-----------------b8b7-------------------b0
"ABCDEFGHIJK"
+1
+2
b15------------------b8b7-------------------b0
S
S
S
S
S
S
5 characters starting from 5th character
     
 
    +1
S
S
42H(B)
41H(A)
44H(D)
43H(C)
4AH(J)
00H
4BH(K)
00H
"EFGHI"
+1
S
S
5
5
1st character
Target character string (extraction source)
Extracted character string
Command
input
  
S
1
  
S
2
  
S
2
  
S
1
   
D
4AH(J)
49H(I)
48H(H)
46H(F)
45H(E)
47H(G)
4AH(J)
49H(I)
4BH(K)
46H(F)
45H(E)
48H(H)
47H(G)
4BH(K)
5th character
+1
+2
+4
+3
+5
b15-----------------b8
“ABCDEFGHIJK”
+1
+2
b15-----------------b8b7-------------------b0
S
S
S
S
S
S
S
42H(B)
41H(A)
44H(D)
43H(C)
00H
“FEGHIJK”
+1
S
S
-1
5
00H
+3
b7-------------------b0