CRC16 (var, count) |
Purpose | This function returns the computed CRC16 for a range of integers starting from variable "var" with the range indicated in the parameter "count". The maximum value allowed for the range is 127. All higher values will be ignored and the result will be invalid. CRC16 is a 16-bit version of "Cyclic Redundancy Check" - a popular mathematical formula for checking error in a data stream. |
Examples | DM[100] = CRC16(DM[5],8) X = CRC16(RELAY[2],4) |
Comments: | CRC16 for DM[5], DM[6]
..DM[12] will be assigned to
DM[100] CRC16 for RELAY[2], RELAY[3], RELAY[4] will be assigned to X. Note: When assigning the result of CRC16 to 32-bit variables the appropriate sign extension will be added. If the resulting value is negative, the upper 16 bits will be &HFFFF. Otherwise the upper 16 bits will be &H0000. This is because all variables are signed in TRiLOGI. |