Chapter 5 Instruction Specifications
5-124
Item number FUN instructions-1 Name General purpose port switching
Ladder format Condition code
Processing time (µs)
Remark
R7F4 R7F3 R7F2 R7F1 R7F0
Average Maximum
FUN 5 (s) DER ERR SD V C
↕
zzzz
Instruction format Number of steps
114 -
Condition Steps
FUN 5 (s) — 3
Bit Word Double word
Usable I/O
XY
R,
M
TD, SS,
CU, CT WX WY
WR,
WM TC DX DY
DR,
DM
Constant
Other
sArgument {
s+1 (system area) {
s+2 (system area) {
Function
This command is to switch dedicated port (programming port) to general purpose port.
S
Port number Current setting
System area
System area
S+1
S+2
Port number
H01 : Port 1
H02 : Port 2
* Error with the other values
Current setting
H00 : Dedicated port (Programming port)
H01 : Port 1 is general purpose port
H02 : Port 2 is general purpose port
Notes
• General purpose port can be configured only one port. If either port is configured general purpose port, FUN 5 command for
the other port is ignored with DER=1.
• General purpose works only when CPU is in RUN mode. When CPU status is in STOP, the port is automatically switched
back to dedicated port (programming port).
• It is impossible to switch from general purpose to dedicated port while CPU is in RUN status.
• FUN 5 does not work if port 1 is configured as modem mode.
Program example
X00000 DIF0
LD X00000
AND DIF0
[
WR0100 = H0200
]
WR0100 = H0200
FUN 5 (WR0100)
FUN 5
(
WR0100
)
Program description
Port 2 is switched to general purpose port at rising edge of X0000 input.
FUN 5 (s)