66
model 3000 DeviceNet Module Manual (DN311/DN311A)
Chapter 4 Operating Procedures for the DN311 (Software)
4
(6) How to use the semaphore area
Figure 4-15 shows how to use the areas and registers discussed in Items (1) to (5).
The shaded parts of the figure indicate that "1" has been set in the each register.
(a) Use an MREAD instruction to read the acknowledgement flag register and to
check that it reads 0. If it reads other than 0, write "0" in in it (for the first time
only).
(b) Use an MWRITE instruction to write request data to the DN311 in the request
area (beginning with 0728H).
(c) Use an MWRITE instruction to write "1" in the request flag register.
(d) Use an MWRITE instruction to write "1" in the request register.
(e) Use an MREAD instruction to read the acknowledgement flag register and waits
until it reads 1.
(f) Use an MREAD instruction to read response data of the DN311 from the
acknowledgement area when the acknowledgement flag register reads 1.
(0660H at the top).
(g) Use an MWRITE instruction to write "0" in the acknowledgement flag register.
(Returns to b).
Figure 4-15 How to Use the Semaphore Area on Requests
(7) Precautions in using the semaphore area
• Since only a pair of request area and acknowledgment area is available, issue the
next request after the DN311 returns the acknowledgement of a request from the
S controller.
• Don't write data (no MWRITE instruction) in the acknowledgement area/acknowl-
edgement flag register. Otherwise, data could be destroyed.(except (6)(g))
• When writing data in the request area using an MWRITE instruction, be careful of
the top address and the size of data to be written. Failing to do so could lead to
the destruction of the data in other areas, possibly causing the DN311 to malfunc-
tion.
S controller
Request area
write
Acknowledgement
area read
Requested Acknowledgement flag Completion of
register read acknowledgement
Request flag
register
area read
Request notice
Request
register
Completion of
request area read
Acknow ledgement
flag register
Responded
DN311
DN311
internal processing
Request area read Acknowledgment area write