Moxa Technologies 331 User Manual Page 19

  • Download
  • Add to my manuals
  • Print
  • Page
    / 101
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 18
UC-7112-LX Plus Software User’s Manual Getting Started
2-11
Developing Your First Application
We use the tcps2 example to illustrate how to build an application. The procedure outlined in the
following subsections will show you how to build a TCP server program plus serial port
communication that runs on the UC-7112-LX Plus.
Testing Environment
The tcps2 example demonstrates a simple application program that delivers transparent,
bi-directional data transmission between the UC-7112-LX Plus’s serial and Ethernet ports. As
illustrated in the following figure, the purpose of this application is to transfer data between PC 1
and the UC-7112-LX Plus through an RS-232 connection. At the remote site, data can be
transferred between the UC-7112-LX Plus’s Ethernet port and PC 2 over an Ethernet connection.
Write data to PC1
Receive LAN data
Read serial data
Send data to PC2
tcps2.c
Serial Rx
Buffer
LAN Rx
Buffer
RS-232 LAN
PC 2PC 1
1P 2P
XT
XR
1P
2P
XT
XR
ydaeR
+V TESER
V84-21
1NAL
584/224/232-SR
2NAL
0117-CU
rotacinummoC lasrevinU
Compiling tcps2.c
The source code for the tcps2 example is located on the CD-ROM at
CD-ROM://example
/UC-7112-LX_Plus/TCPServer2/tcps2.c.
Use the following commands to copy the file to a specific directory on your PC. We use the
direrctory /home/UC-7112Plus/1st_application/. Note that you need to copy 3 files from the
CD-ROM to the target directory: Makefile, tcps2.c, tcpsp.c.
#mount –t iso9660 /dev/cdrom /mnt/cdrom
#cp /mnt/cdrom/example/UC-7112-LX_Plus/TCPServer2/tcps2.c /home/UC-7112Plus/1st_application/tcps2.c
#cp /mnt/cdrom/example/UC-7112-LX_Plus/TCPServer2/tcpsp.c /home/UC-7112Plus/1st_application/tcpsp.c
#cp /mnt/cdrom/example/UC-7112-LX_Plus/TCPServer2/Makefile /home/UC-7112Plus/1st_application/Makefile
Type #make to compile the sample code:
You will get the following response, indicating that the example program was compiled
successfully.
Page view 18
1 2 ... 14 15 16 17 18 19 20 21 22 23 24 ... 100 101

Comments to this Manuals

No comments