33 Applied Instructions (Extension File Register Control)
33.3 INITR / Initialize R and ER
760
FXCPU Structured Programming Manual
[Basic & Applied Instruction]
Error
An operation error is caused in the following cases. The error flag M8067 turns ON, and the error code is
stored in D8067.
1) When any device number other than the head device number of a sector of extension file registers is set
to .
(Error code: K6706)
2) When a device number to be initialized exceeds "32767". In this case, devices up to R32767 (ER32767)
are initialized.
(Error code: K6706)
3) When the protect switch of the memory cassette is set to ON. (Error code: K6770)
Program example
In the program example shown below, the extension registers R0 to R2047 in the sector 0 are initialized.
Note that the extension file registers ER0 to ER2047 are also initialized if a memory cassette is attached.
1) Extension registers (R) [inside the built-in RAM memory]
Device number
Current value
Before
execution
After
execution
RO H1234 HFFFF
R1 H5678 HFFFF
R2 H90AB HFFFF
...
...
...
R2047 HCDEF HFFFF
X000
WDT
EN ENO
LDP
EN ENO
s
INITR
EN
s
n
ENO
R0
WDT
EN ENO
K1
[Structured ladder/FBD]
[ST]
WDT(LDP(TRUE,X000));
INITR(LDP(TRUE,X000),R0,K1);
WDT(LDP(TRUE,X000));