Appendix 4 Program Examples - Mitsubishi Electric FX3U-ENET User Manual

Hide thumbs Also See for FX3U-ENET:
Table of Contents

Advertisement

APPENDIX

Appendix 4 Program Examples

Receive remaining
response messages
Insufficient size
of data received
App - 5
The program examples presented in this section test the connection between the
Ethernet module and an external device (personal computer) that is connected to the
same Ethernet.
For each program, only the minimum programming that is required to perform the
communication test is done. Modify the IP address, port number and other values
according to your system configuration. In addition, abnormal handling may be added.
(1) Receive processing of target device
A receive processing example on the target device side is shown below.
Communication processing
on the external device side
Request message/transmission processing
Response message/reception processing
Is the TCP connection open?
Was the reception data
received within the time allotted
by the monitoring timer?
Check the size of the received data
Response message processing
Have all the received
messages been processed?
End
Background
For Ethernet communications, the TCP socket functions are used inside the
personal computer. However, these functions do not have any limits. Therefore,
when the "send" function is executed once to transmit data, the receiving end (node)
needs to execute the "recv" function once or more in order to read the data ("send"
and "recv" is not proportional to 1:1 execution). For this reason, the receiving
procedure explained above, is required.
The TCP connection is closed
Timeout of monitoring timer
If a response message to the
next request was received
MELSEC-F
Error handling
App - 5

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Fx3u-enet-l

Table of Contents