GXDN: Gurux Developer Network
CountChecksumEventHandler Delegate
NamespacesGurux.ClientCountChecksumEventHandler
GXClient component calls this method when the checksum is counted.
Parameters
sender (GXClient)
The source of the event.
gxpacket (GXPacket)
Packet which checksum is counted.
checksum ( Object %)
Counted checksum.
checksumType ( VariantType %)
Type of counted checksum.
Remarks
If own checksum count is used, the SetChecksumParameters ChkType property must be set to Own (GX_CHK_OWN). If checksum type is something different than Own (GX_CHK_OWN), this method is not called.
Examples
CopyVBScript
'Count checksum for packet.
'In this example checksum is the count of all data. 
'Checksum is the count of data values of the added packet and it returns checksum as byte value.
sub GXClient1_CountChecksum(object GXPacket, object Checksum, GX_VARTYPE ChecksumType)
dim data, cnt, pos, 
'Extract all data to the variable
GXPacket.ExtractData data, GX_VT_BYTE, 0, -1
cnt = UBound(data)
Checksum = 0
for pos = 0 to cnt - 1
    Checksum = Checksum + data(pos)
next
ChecksumType = GX_VT_BYTE
end sub
'Note!
'Don't use this example to count checksum in real application.
'This is only an example and a simple one.
See Also

Assembly: Gurux.Client (Module: Gurux.Client) Version: 5.0.0.1