Mitsumi electronic NZ2GF-ETB ユーザーズマニュアル
101
CHAPTER 7 COMMUNICATION OF THE ETHERNET ADAPTER MODULE
7
7.2 C
ommunication Usin
g the On-deman
d Function
7.2.7 Example of on-
demand data
send
ing
7.2.7
Example of on-demand data sending
This section explains how to send on-demand data and provides a program example.
(1) How to send data
Follow the instructions below to send on-demand data.
(a) Ethernet adapter module
1.
Connect the Ethernet adapter module to CC-Link IE Field Network and Ethernet. (
Section 7.1)
Before connecting to Ethernet, establish connection between an external device and the Ethernet
adapter module.
Before connecting to Ethernet, establish connection between an external device and the Ethernet
adapter module.
(b) CPU module (for channel 1)
1.
Write parameters and a program to the CPU module and reset the CPU module.
(
2.
Run the CPU module.
3.
Read Send completed flag (buffer memory address: 5633 (1601H)) in the Ethernet adapter module
using the REMFR instruction.
When the 0th bit or 1st bit of Send completed flag is 1 (ON), set the 0th bit of Send request flag (buffer
memory address: 5632 (1600
using the REMFR instruction.
When the 0th bit or 1st bit of Send completed flag is 1 (ON), set the 0th bit of Send request flag (buffer
memory address: 5632 (1600
H
)) to 0 (OFF).
4.
Set Control data (buffer memory address: 5635 to 5643 (1603
H
to 160B
H
)) and Send data (buffer
memory address: 5644 to 6603 (160C
H
to 19CB
H
) in the Ethernet adapter module using the REMTO
instruction.
5.
Set Send request bit of Send request flag in the Ethernet adapter module to 1 (ON) using the
REMTO instruction.
REMTO instruction.
6.
On-demand data is sent.
7.
Read Send completed flag and Completion code (buffer memory address: 5634 (1602
H
)) in the
Ethernet adapter module using the REMFR instruction.
If the 1st bit of Send completed flag is 1 (ON), check Completion code (error code) and remove the error
cause. (
If the 1st bit of Send completed flag is 1 (ON), check Completion code (error code) and remove the error
cause. (
8.
Set Send request flag and Send completed flag to 0 (OFF).
(c) External device
1.
Receive on-demand data.
2.
Find whether the received data is on-demand data or data received using a command.
When the command No. in the message is 2101, the data is on-demand data.
When the command No. in the message is 2101, the data is on-demand data.
3.
Process the data.
For details on the buffer memories used for the on-demand function, refer to