W&T 57630 Manual page 110

Web-io series 12+12 digital
Table of Contents

Advertisement

W&T
WORD send_sequence;
WORD rec_sequence;
WORD struct_typ;
WORD length;
WORD set_bits;
WORD value;
} SETBIT;
The Variables are in this case byte-aligned „Lowbyte First" in
memory.
To achieve byte alignment even for structures consisting of dif-
ferent variable types, please use the compiler option #pragma
pack(1).
#pragma pack(1);
typedef struct _COUNTER
{
word send_sequence;
word rec_sequence;
word struct_typ;
word length;
word
counter_index;
long
counter_value
}
COUNTER;
#pragma pack()
Byte alignment in memory is important so that for example the
sequence of bytes resulting from passing a pointer to the
structure can be inserted directly into a TCP packet.
Visual Basic 5 and 6
Visual Basic offers the programmer the every easy-to-use
Winsock control element for network communication via TCP/
IP.
Unfortunately the VB Winsock control element does not allow
working with structures. Instead, data communication is handled
using string variables.
110
TCP / UDP - Binary

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

57631

Table of Contents