Appendix C-1 Program Example For Communication Using Mc Protocol -1 - Mitsubishi Electric FX3U-ENET-ADP User Manual

Table of Contents

Advertisement

FX
-ENET-ADP User's Manual
3U

Appendix C-1 Program example for communication using MC protocol -1

The following explains a program example, its execution environment and the contents of data
communication.
1) Execution environment of the program example
a) PLC side
- Main unit of the Ethernet installed station :FX
- Ethernet adapter No. :
- Ethernet adapter IP address :
- Ethernet adapter port number :
- GX Works2 setting
• Operational Settings :Refer to the following "3) GX Works2 setting a)"
• Open settings :
b) External device side
- Operation environment :
- Ethernet interface board model name : WINSOCK compatible board
- Library :
- Software development environment : Microsoft Corporation Visual C++ .NET
- Ethernet address :
- IP address :
- Port number :
c) Communication protocol : TCP/IP
2) Outline of the program example
a) Sequence program on the PLC side
Parameters are set from GX Works2.
(Sequence program is not required)
b) Program on the external device side
Executes the following read/write data communication with the PLC using the library mentioned
above.
- Write in word units (for 5 points from D0 to D4)
- Read in word units (for 5 points from D0 to D4)
3) GX Works2 settings
Set the PLC parameters as follows.
a) Operation settings
Communication data code :ASCII
Initial timing :
IP address :
b) Open settings
Protocol :
Open system :
Existence confirmation :
Local station Port No. :
4) Program on the external device side
The program example of the external device shown below accesses the FX
which the Ethernet adapter is installed.
When this program is executed, the contents of the following communication messages are displayed in
sequence:
a) Batch write command message in word units
b) Batch write response message in word units
c) Batch read command message in word units
d) Batch read response message in word units
Appendix C-1 Program example for communication using MC protocol -1
/FX
3U
No.1
172.16.56.99 (AC.10.38.63H)
10000
Refer to the following "3) GX Works2 setting b)"
Microsoft Windows 2000 Operating system
WSOCK32.LIB
Setting not required because the ARP function is available
Receive at Active open
Receive at Active open
Always wait for OPEN (Communication possible at STOP time)
172.16.56.99 (AC.10.38.63H)
TCP
Unpassive (MC)
No confirm
10000
Appendix C: Program Examples
3UC
/FX
3U
B
C
D
E
of the station in
3UC
133

Advertisement

Table of Contents
loading

Table of Contents