Sets the parameters needed to calculate the checksum.
Note: Parameters CRCSize, CRCPolynomial, CRCInitialValue, CRCFinalXOR, CRCReverseData
and/or CRCReflection can be used only, when ChkType is Custom (GX_CHK_CUSTOM).
- position (Int32)
- Checksum position.
- chkType (Checksum)
- Checksum type.
- start (Int32)
- Zero indexed starting point of position, where checksum count is started.
- size (Int32)
- Determines, how many bytes are counted for checksum. Set to -1 if all data is counted.
- crcSize (Int32)
- The size of the CRC (Cyclic Redundancy Check) checksum, given in bits.
- crcPolynomial (Int32)
- The polynom of the CRC (Cyclic Redundancy Check) checksum.
- crcInitialValue (Int32)
- The initial value of the CRC (Cyclic Redundancy Check) checksum.
- crcFinalXOR (Int32)
- The integer on which, with the calculated CRC (Cyclic Redundancy Check) checksum, the XOR operation is done, at the end.
- crcReverseData (Boolean)
- If True, the calculated CRC (Cyclic Redundancy Check) checksum is reversed at the end.
- crcReflection (Boolean)
- If True, bits of the calculated CRC (Cyclic Redundancy Check) checksum, are swapped around its centre.
Media must be selected before using this method. If checksum type is Own (GX_CHK_OWN), own checksum count can be used.
In that case ClientEvents.CountChecksum method is called every time, when checksum needs to be counted.
If checksum is not used, set ChkType to None (GX_VT_NONE), as it is by default, too.
The Position parameter determines the position, where checksum is inserted to.
Position is byte position in the stream. Positive value indicates that count is started from the beginning and
negative indicates that count is started from the end. Set Position to 0, if checksum is before BOP.
If checksum is inserted after EOP, set Position parameter to -1.
If checksum is inserted before EOP set Position parameter to -2.
The Start parameter tells from which byte the counting starts
and the Size parameter determines how many bytes are included in the counting of the checksum.
If all data is counted for the checksum, set Size parameter to -1. If all data, except the last byte, is counted,
set Size parameter to -2.
Negative values are used, because the size of packet is not always known.
Negative values indicate that GXCom counts from the right position.
'Insert checksum before BOP. Use CRC16 and count all data for checksum. GXClient1.SetChecksumParameters 0, GX_CHK_CRC16, 0, -1 CRC | BOP | Header | Data | EOP 'Insert checksum after BOP. Use CRC16 and count all data for checksum. GXClient1.SetChecksumParameters 1, GX_CHK_CRC16, 0, -1 BOP | CRC | Header | Data | EOP 'Insert checksum after EOP. Use CRC16 and count all data for checksum. GXClient1.SetChecksumParameters -1, GX_CHK_CRC16, 0, -1 BOP | Header | Data | EOP | CRC 'Insert checksum before EOP. Use CRC16 and ignore first two bytes for checksum count. GXClient1.SetChecksumParameters -2, GX_CHK_CRC16, 2, -1 BOP | Header | Data | CRC | EOP
Assembly: Gurux.Client (Module: Gurux.Client) Version: 5.0.0.1