3. Creating the
WinSock Demo
3.1.
WinSock Demo
action plan
We will show you the basics of communicating with the DS100/EM100SK in three steps:
•
we will create a very simple program that will be able to exchange the data with the Data
Port of the DS100/EM100SK using an UDP/IP protocol
•
we will show how to program (setup) the DS100/EM100
over the network
. Same UDP/IP
protocol will be used, but this time to communicate with the Command Port of the DS100/EM100SK
•
we will show how to exchange data with the DS100/EM100 using the TCP/IP protocol.
Supporting TCP/IP is slightly more difficult so we will do this at the end of the
Tutorial.
You can follow our instructions step-by-step or you can download a completed project for each of the
steps from
. The projects are archived (.zip) and named “
WinSock Demo
Step1
”, “
WinSock Demo Step2
”, and “
WinSock Demo Step3
”.
Important:
you may need to change the
RemoteHost
property of the
WinSock
control in each project to the actual IP-address you’ve set for your
DS100/EM100.
3.2. Step 1: creating a simple UDP/IP
Demo
Follow the instructions below to complete the first step of our action plan:
•
Lunch the
Visual Basic (VB)
, choose the
Standard EXE
project
•
Rename the default form (Form1) to
FormMain
, set its caption to “WinSock Demo”
•
Save the project (and do use the
Save
button often!)
•
Add the
WinSock
control to your Project:
o
Choose
Project
"
Components
from the main menu-
Components
dialog will open