|
GXPacket
| |
|
Purpose of GXPacket is to offer an easy way
to handle data that is send to the device. GXPacket defines the common packet layer, which consists of: ![]() BOP (Beginning of Packet)
A data packet can have a starting marker that describes the beginning of the packet;
a BOP tells, where a new packet starts. If BOP is used, GXCom adds a BOP to the packet,
when the packet is sent. When new data is received, GXCom tries to find BOP character(s)
from the stream, before handling the packet.
If a BOP is not used, set the type of BOP to None (GX_VT_NONE). Supported BOP types are:
Header part
The header part describes the content of the packet.
For example, data size, packet ID, and packet status can be described in the header. The header is protocol dependent, and some protocols do not support a header part at all. Data part
Data part describes the actual data in the packet.
EOP (End of Packet) | |
A data packet can also have an ending marker that describes the end of the packet;
an EOP tells, where the packet ends. If EOP is used, GXCom adds an EOP to the packet,
when the packet is sent. When new data is received, GXCom tries to find EOP character(s)
from the stream, before handling the packet.
If an EOP is not used, set the type of EOP to None (GX_VT_NONE). Supported EOP types are:
Checksum
A check sum can be used to ensure that the contents of the packet has not been corrupted.
GXCom supports several different kind of check sums. The supported check sum types are defined in ChkType (GX_CHECKTYPE) enumeration. By default, the checksum is None (GX_CHK_NONE). To use your own checksum, set the the ChkType to Own (GX_CHK_OWN). When an own check sum is used, GXClient calls CountChecksum method every time, when a new check sum needs to be counted. If a check sum is not used, set the type of check sum to None (GX_VT_NONE), with GXClient SetCheckSumParams method. Note: BOP, header, EOP, and checksum are not obligatory. Using these parameters depends on, what kind of protocol you use. Using the components from development environment Using from .NET | Using from Visual Basic | Using from C++ | Parameter Types | |
