User manual Version 2.3
ABLELink
Serial-Ethernet Server
GW21W
6. Start Writing Your Own Applications
Before you start writing your host applications or programs to interact with GW21W, please make sure you
have done the following.
6.1 Preparing The System
1. Properly connect GW21W hardware including power, Ethernet and RS-232/RS-485 cables.
2. Properly configure the parameters of GW21W including connection type, IP address, gateway IP
address, and network mask accordingly (see chapter 2
Hardware Installation
section).
3. Configure GW21W as TCP Server using default TCP port number 4660.
4. The host (PC) application program must be configured as a TCP client and connects to GW21W with
designated TCP port number 4660 for COM1.
5. Make sure GW21W is running by checking the running status through
monitor.exe
configuration
utility.
6.2 Running The Sample Program
Sample programs written in VB and VC++ included in package are provided for your reference, source
codes are also included. Test program can be found in the product CD or diskette under the directory of
\sample\vb_ap\
and
\sample\vc_ap
respectively.
There are two test programs, TCPTEST written in Visual Basic and TCPTEST2 written in Visual C++.
6.2.1TCPTEST in Visual Basic
This sample program is written in Visual Basic 5.0 with Winsock Controls. It shows you how to send and
receive data between host (PC) and GW21W via Ethernet in two socket ports.
Run Visual Basic and open sample program tcptest.vbp, after the program is started successfully, you can
start testing functions. For more information, please press
Help
in the program to get detail explanation.
Note:
Please be sure the Microsoft visual studio family software is installed on the computer. Otherwise
the sample program will not run.
Copyright © 2003 Atop Technologies, Inc.
All rights reserved. Designed in Taiwan.
38/52