W&T 57630 Manual page 114

Web-io series 12+12 digital
Table of Contents

Advertisement

W&T
RCounter=packed record
send_sequence:word;
rec_sequence:word;
sruct_type:word;
length:word;
counter_index: word;
counter_value: longword;
end;
The structures must in any case be defined as packed record. The
packed addition ensures that the sequence of Low and High byte
is correct when sending (Low-Byte first).
The defined IO structures must be declared as variables:
var
Form1
: TForm1;
ReadCounter
: RReadCounter;
Counter
The following procedure opens the TCP connection:
procedure TForm1.bConnectClick(Sender: TObject);
begin
ClientSocket1.Host:= '172.16.232.17';
ClientSocket1.Port:= 49153;
ClientSocket1.Open;
end;
Invoking the next procedure sends the Read Counter structure to
the Web-IO:
procedure TForm1.bSendClick(Sender: TObject);
begin
// Fill the ReadCounter structure
ReadCounter.send_sequence = 0
ReadCounter.rec_sequence = 0
ReadCounter.struct_type = $B0
ReadCounter.length = 10
ReadCounter.counter_index = 11 '// Input-Counter 11
ClientSocket1.Socket.SendBuf(ReadCounter,10);
114
: RCounter;
TCP / UDP - Binary

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

57631

Table of Contents