15
At this point you will likely be shown… an error message saying some nonsense like “Address family is not
supported” or just an error code without any explanation. This is a peculiar bug in the WinSock control. Manual way
around this situation is to stop the program and simply click once on the WinSock control in your FormMain form (in
the design mode). Next time you run the Demo this problem won’t show up! This is not a solution for a “real”
application you are probably starting to develop. One way to avoid this annoying message is to use the OnError
statement to filter out the error.
•
Well, again (if necessary
☺
)… run the
Demo
, type any string and press
Send
- the string will appear
in the
HyperTerminal’s
window
•
Type anything in the
HyperTerminal’s
window- the same string will appear in the
Receive
textbox of
your
Demo
.
•
Congratulations! Step 1 successfully completed!
3.3. Step 2: learning to control the DS100/EM100 over the network
The DS100/EM100 can be programmed (setup) over the network (see
Section 4.3
of the
DS100 Tech
Manual
). Programming commands are sent as UDP datagrams (one datagram per command) to the
DS100/EM100’s Command Port whose number is fixed at 65535. Most of the commands are the
same as the ones you can issue via the serial port in the Serial Programming Mode. In addition there
are many commands that can only be sent over the network. The difference in command and reply
formats is that you don’t have to type <Ctrl-B> and <CR> for the network commands. Let’s test this
out:
•
Stop the Demo
•
Change the
RemotePort
property of the
WinSock
control to 65535
•
Make the contents of each datagram arriving from the DS100/EM100 appear in the
TxtRcv
textbox on a separate line. Change the code for the
DataArrival
event of the
WinSock
as follows:
Private Sub WinSock_DataArrival(ByVal bytesTotal As Long)