External Device Receiving Process; Appendix 11 Example Of External Device Program - Mitsubishi Electric MELSEC iQ-RJ71EN71 User Manual

Ethernet
Hide thumbs Also See for MELSEC iQ-RJ71EN71:
Table of Contents

Advertisement

Appendix 11
An example of the program in the external device connected to the same Ethernet as the Ethernet-equipped module is shown
below. Each program is the minimum required program for the communication test. Change the IP address or port number
according to the system. When including process for errors, add it separately.

External device receiving process

An example of the external device receiving process is shown below.
Communication processing on the external device
Response message/receive processing
Receive the remaining
response messages.
The received data size
is insufficient.
When communicating with Ethernet, the TCP socket functions (socket functions) are used in the personal
computer. There is no concept of boundary with these functions. When the send side calls the send function
once and sends data, the receiving side must call the recv function once, twice, or depending on the
circumstance more times to read that data. (send and recv do not correspond one-on-one.) Thus, the external
device's program process must execute the receiving process as shown above.
APPX
404

Appendix 11 Example of External Device Program

Example of External Device Program
Request message/send processing
Is the TCP connection open?
Were the data
received within the monitoring
timer value?
Check the received data size.
Response message processing
Have all the received messages
been processed?
End
The TCP connection is closed.
Timeout of the monitoring timer value
If the response message to
the next request has been
received
Error processing

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents