F.1 Checksum Enable/Disable - Advantech Adam 4000 Series User Manual

Data acquisition modules
Hide thumbs Also See for Adam 4000 Series:
Table of Contents

Advertisement

A checksum helps you detect communication errors between the host and module.
This feature adds two extra checksum characters to the command or response
string; therefore, it reduces the throughput.
F.1
Checksum Enable/Disable
In order to enable configuration of a module's checksum feature, its INIT* terminal
should be shorted to its GND terminal. Then, the module should be rebooted. The
checksum feature is enabled by setting bit 6 of the data format/checksum parameter
to 1. On the other hand, the checksum is disabled by setting the parameter to 0.
Whenever the checksum feature is used, all the connected devices including the host
computer should be in enable mode.
The checksum is represented by a 2-character ASCII hexadecimal format and is
transmitted just prior to the carriage return. The checksum equals to the result after
performing modulus-256 (100h) of all the ASCII values' sum preceding the check-
sum. If the checksum is missing or incorrect, the module will not respond.
Example 1
The following example is an Analog Data In command and response when the
checksum is enabled:
Command: #0588(CR)
Response: +3.56719D(CR)
The input value of the module at address 05h is +3.5671 V. (The data format is in
engineering units.) The command checksum (88h) is the sum of the ASCII values for
the following characters: #, 0, and 5. The response checksum (9Dh) is the sum of the
ASCII values for the following characters: ">", "+", "3", ".", "5", "6", "7", and "1".
Example 2
This example explains how to calculate the checksum value of a Read High alarm
limit command string:
Case 1. (If the Checksum feature is disabled)
Command: $07RH(cr)
Response: !07+2.0500(cr) when the command is valid.
Case 2. (If the Checksum feature is enabled)
Command: $07RH25(cr)
Response: !07+2.0500D8(cr)
where:
25 represents the checksum of this command, and
D8 represents the checksum of the response.
The checksum of the command string is derived as shown below:
25h = (24h+ 30h + 37h + 52h + 48h) MOD 100h
The hexadecimal ASCII codes for $, 0, 7, R, H are 24h, 30h, 37h, 52h and 48h
respectively. The sum of these ASCII codes is 125h, and the result equals to 25h
after modulus-256(100h) execution.
ADAM-4000 Series User Manual
356

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents