GXClient component calls this method, if the client application uses its own parsing method, instead of the one of GXCom.
This method is called only, if ParseReceivedPacket is set True.
'In this example we presume that data starts with char 01 and ends with 02 and all data is ASCII. sub GXSClient1_ParsePacketFromData(object Data, object GXPacket, int PacketSize) dim BOP_Pos, EOP_Pos, Pos BOP_Pos = 0 EOP_Pos = 0 'Find BOP for Pos = 0 to PacketSize -1 if Data(Pos) = 01 then BOP_Pos = Pos end if next 'Find EOP for Pos to PacketSize -1 if Data(Pos) = 02 then EOP_Pos = Pos end if next 'Don't go further if packet is not found if BOP_Pos = 0 or EOP_Pos = 0 PacketSize = 0 exit sub end if 'Reset packet and append new data as byte array GXPacket.AppendData, data, GX_VT_BYTE or GX_VT_ARRAY PacketSize = EOP_Pos end sub
Assembly: Gurux.Client (Module: Gurux.Client) Version: 5.0.0.1