Appendix C: Program Examples
133
FX
3U
-ENET-ADP User's Manual
B
Ve
rsion
Inform
ation
C
Program
Examples
D
Di
fferences w
ith
FX
3U
-E
N
E
T
E
D
ocum
ent,
oth
ers
Appendix C-1 Program example for communication using MC protocol -1
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
3U
/FX
3UC
- Ethernet adapter No. :
No.1
- Ethernet adapter IP address :
172.16.56.99 (AC.10.38.63H)
- Ethernet adapter port number :
10000
- GX Works2 setting
• Operational Settings :Refer to the following "3) GX Works2 setting a)"
• Open settings :
Refer to the following "3) GX Works2 setting b)"
b) External device side
- Operation environment :
Microsoft Windows 2000 Operating system
- Ethernet interface board model name : WINSOCK compatible board
- Library :
WSOCK32.LIB
- Software development environment : Microsoft Corporation Visual C++ .NET
- Ethernet address :
Setting not required because the ARP function is available
- IP address :
Receive at Active open
- Port number :
Receive at Active open
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 :
Always wait for OPEN (Communication possible at STOP time)
IP address :
172.16.56.99 (AC.10.38.63H)
b) Open settings
Protocol :
TCP
Open system :
Unpassive (MC)
Existence confirmation :
No confirm
Local station Port No. :
10000
4) Program on the external device side
The program example of the external device shown below accesses the FX
3U
/FX
3UC
of the station in
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
Summary of Contents for FX3U-ENET-ADP
Page 1: ...FX3U ENET ADP USER S MANUAL ...
Page 2: ......
Page 6: ... 4 Safety Precautions Read these precautions before use MEMO ...
Page 161: ......