26 Applied Instructions (Character String Control)
26.8 MIDW / Random Replacement of Character Strings
646
FXCPU Structured Programming Manual
[Basic & Applied Instruction]
Program examples
In the program example shown below, four characters are extracted from the character string data stored in
D0 and later, and stored to the third character (from the left end) and later for the character string data stored
in D100 and later when X010 turns ON.
59H(Y) 43H(C)
31H(1) 5AH(Z)
31H(1) 32H(2)
45H(E) 46H(F)
31H(1) 32H(2)
45H(E) 46H(F)
X010
D1
D2
D3
"21FE03"
D100
D101
33H(3) 30H(0)
53H(S) 55H(U)
"USCYZ10B"
R1
4
3
D102
D103
42H(B) 30H(0)
0000H
Before execution
53H(S) 55H(U)
"US21FE0B"
0000H
After execution
42H(B) 30H(0)
D0
R0
D104
1st
character
1st
character
4th character
3rd
character
3rd
character
The 1st to 4th characters are stored (overwritten).
00H
MIDW
EN ENO
d
s1
s2
D0
R0
D100
[Structured ladder/FBD]
[ST]
MIDW(X010,D0,R0,D100);
D100
D101
D102
D103
D104
b15 b8 b7 b0
b15 b8 b7 b0
b15 b8 b7 b0