Topic: DMD0305 CHECKSUM - Checksum Algorithm |
|
The Checksum Algorithm (CHECKSUM) instruction is used to calculate a checksum value for the contents of the specified data buffer. This checksum value can be added to the String or stored in a separate memory location in the CPU. Checksum values are typically used in this manner:
Parameters:Note: Use the F9 key or click the 'three dot box' at the right edge of the parameter field to open the Default Element Selection Tool (the Element Picker or the Element Browser) or use the Down-Arrow key (Auto-Complete) on any parameter field to see a complete list of the memory locations that are valid for that parameter of the instruction.
On Buffer - the data buffer that contains the data used to calculate the checksum. Although this any readable numeric location in the CPU, it will typically be a user-defined data buffer, or one of the system-defined Short Strings (SS0 - SS127), or system-defined Long Strings (SL0 - SL63), or any of the user-defined Strings.
Checksum Function - selects the type of checksum calculation to be performed
Initial Value - specifies the initial value for the CRC calculation
Starting Offset - specifies the offset into On Buffer in String to begin the checksum calculation. This can be any readable numeric location or any constant value from 0 to the maximum length of the string.
Ending Offset - specifies how many of the remaining elements in On Buffer in String to include
in the checksum calculation
Destination - specifies a memeory location to store the calculated checksum value. This can be any writable numeric location. Make sure the specified location is large enough to store the result of the checksum calculation.
|
|
Status Display:The Status display of the Checksum Algorithm instruction will only display as many of the location in the source String or data buffer as will fit within the borders of the instruction, typically this is about 50 characters.
|
|
See Also:STREAMIN - Stream In Data from Device
STREAMOUT - Stream Out Data to Device
CHECKSUM - Checksum Algorithm
STRGETB - Get Bytes Out of a String
STRPUTB - Put Bytes Into a String
PACKETIN - Input Data from Packet Device
PACKETOUT - Output Data to Packet Device
|
|
Rung Example:
|
|