App - 5 App - 5
MELSEC-F
APPENDIX
Appendix 4 Program Examples
The program examples presented in this section test the connection between the
Ethernet block and an external device (IBM PC/AT) 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
Is the TCP connection open?
Check the size of the received data
Response message processing
Have all the received
messages been processed?
End
Error handling
If a response message to
the next request was received
Timeout of monitoring timer
The TCP connection is closed
Receive remaining
response messages
Insufficient size
of data received
Request message/transmission processing
Response message/reception processing
Was the reception data
received within the time allotted
by the monitoring timer?
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.
Содержание FX3U-ENET
Страница 1: ...USER S MANUAL FX3U ENET ...
Страница 2: ......
Страница 159: ...8 6 8 6 MELSEC F 8 COMMUNICATION USING MC PROTOCOL MEMO ...
Страница 295: ...App 25 App 25 MELSEC F APPENDIX MEMO ...
Страница 297: ......