111
W&T
TCP / UDP - Binary
Subject to errors and modifications:
To program Web-IO applications in VB, you therefore need to
represent the byte sequence as it is sent when sending a structure
over the network in the form of a string.
The following source text excerpt shows how strings can be
prepared for sending using the example of the ReadCounter
structure.
First the necessary structures and variables need to be declared
in an external module.
Public Type Struct_ReadCounter
send_sequence As Integer
rec_sequence As Integer
struct_type As Integer
length As Integer
counter_index As Integer
End
Type
Public Type Struct_Counter
send_sequence As Integer
rec_sequence As Integer
struct_type As Integer
length As Integer
counter_index As Integer
counter_value As Long
End
Type
Public ReadCounter As Struct_ReadCounter
Public Counter As Struct_Counter
Public Str_ReadCounter As String * 10
Public
Str_Counter
As
String
*
14
The following routine opens the connection to the Web-IO.
Private Sub ButtonConnect_Click()
'// Open TCP connection
Winsock1.RemotePort = 49153
Winsock1.RemoteHost = "172.16.232.17"
Winsock1.Connect
End Sub
Содержание 57630
Страница 8: ...8 W T Content...
Страница 22: ...22 W T Assigning the IP address...
Страница 44: ...44 W T configuring the network parameters...
Страница 194: ...194 W T Diacnostics and testing...
Страница 211: ...211 W T Decalration of conformity Subject to errors and modifications 7 9 Declaration of Conformity...