W&T 57630 Manual page 113

Web-io series 12+12 digital
Table of Contents

Advertisement

W&T
+ 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;
Subject to errors and modifications:
TCP / UDP - Binary
113

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

57631

Table of Contents