![Tibbo DS100 Скачать руководство пользователя страница 21](http://html.mh-extra.com/html/tibbo/ds100/ds100_tutorial_1114115021.webp)
21
•
“Comment out” disable the line in the
Click
event of the
Send
button (we have added this line to
make the
WinSock
correctly display all the replies from the devices in the broadcast mode. In our
current TCP/IP test this is not only unnecessary, but erroneous- in TCP/IP you cannot change the
IP-address after the connection has been established!):
Private Sub CmdSend_Click()
'WinSock.RemoteHost = "255.255.255.255" Comment out for TCP test
WinSock.SendData
TxtSend.Text
End Sub
•
Finally, “comment out” the CR/LF addition to every packet received from the DS100/EM100. It is
convenient for the Network Setup but will look strange for a “normal” data exchange:
Private Sub WinSock_DataArrival(ByVal bytesTotal As Long)
WinSock.GetData
s$
TxtRcv.Text = TxtRcv.Text + s$
‘+ Chr$(13) + Chr$(10) Comment out
End Sub
Now you can test your TCP/IP
Demo
!
•
Run the
Demo
. The
Status
of the TCP/IP connection will be “Closed”. The
Send
button will not be
active
•
Click
Connect
button. The
Status
will change to “Connecting”, then to “Connected”. If the program
cannot connect to the DS100/EM100 (because the device is off, because you are connecting to a
wrong IP-address, because somebody is already connected to this DS100/EM100, etc. etc.) then
the
Status
will hang on “Connecting” for a while, then change to “Error”
•
With TCP/IP connection established the
Send
button will be enabled and you can exchange the
data between the
Demo
and the
HyperTerminal
And this is the end of our Tutorial. Hope this wasn’t too boring!
☺