113
W&T
TCP / UDP - Binary
Subject to errors and modifications:
+ Asc(Mid(Str_Counter, 2, 1)) * &H100
Counter.rec_sequence = Asc(Mid(Str_Counter, 3, 1)) _
+ Asc(Mid(Str_Counter, 4, 1)) * &H100
Counter.struct_type = Asc(Mid(Str_Counter, 5, 1)) _
+ Asc(Mid(Str_Counter, 6, 1)) * &H100
Counter.length = Asc(Mid(Str_Counter, 7, 1)) _
+ Asc(Mid(Str_Counter, 8, 1)) * &H100
Counter.counter_index = Asc(Mid(Str_Counter, 9, 1)) _
+ Asc(Mid(Str_Counter, 10, 1)) * &H100
Counter.counter_value = Asc(Mid(Str_Counter, 11, 1)) _
+ Asc(Mid(Str_Counter, 12, 1)) * &H100 _
+ Asc(Mid(Str_Counter, 13, 1)) * &H10000 _
+ Asc(Mid(Str_Counter, 14, 1)) * &H1000000
End
Sub
The example shown above can of course also be applied to all
other structures.
Delphi
Since Delphi offers very straightforward support of structures,
using it to handle IO structures is a simple matter. Delphi also
provides a socket control element for network communication
that can be used for exchanging data with the Web-IO.
The following source text excerpts show how you can use the
ReadCounter
and
Counter
structures to read the counter state of
an input counter.
First the IO structures ReadCounter and Counter need to be
defined as new variable types
RReadCounter
and
RCounter
.
RReadCounterr=packed record
send_sequence:word;
rec_sequence:word;
sruct_type:word;
length:word;
counter_index: word;
end;
Содержание 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...