2.13 Communications with a Windows PC (Visual C++ Application)
Using Automatic Reception with the MP3000 as a Slave
2-345
Setting the Other Device (Windows PC Running a Visual C++ Application)
The following section outlines a Visual C++ application for connecting the MP3000 and a PC, and
describes a sample program.
Overview of the Visual C++ Application
The following figure shows an example of a Visual C++ application for connecting the MP3000 to a PC.
When communications starts, the sample application reads 10 words from the MW00000 to MW00009
hold registers in the MP3000 and displays the current values on the screen.
Set the PC’s IP address.
Set the PC’s port number.
Set the MP3000’s IP address.
Set the MP3000’s port number.
Select the connection type.
Start the processing to open a TCP/UDP connection.
When this button is clicked, a socket is created based on the settings from 1 to 6 and the TCP connection
opening procedure is executed.
Start the message communications process of reading register values in the MP3000.
When this button is clicked, a 100-ms cyclic timer starts that triggers execution of the message send/
receive process.
The register values read from the MP3000 are displayed in the register monitor.
Stop the message communications process of reading register values in the MP3000.
When this button is clicked, the 100-ms cyclic timer stops and causes the message send/receive process
to stop.
The register values read from the MP3000 are displayed.
Close the application.
When this button is clicked, processing to close the socket is executed and the application is closed.
The sample program that is listed here is provided as a programming example and it may not work in
all situations. In addition, Visual C++ must be installed on your PC.