Command – Measurement Computing CB-COM-7021 User Manual
Page 26

26
CB-7021, CB-7022, CB-7024 User’s Manual
2. Command
Command Format: (Leading)(Address)(Command)[CHK](cr)
Response Format: (Leading)(Address)(Data)[CHK](cr)
[CHK]
2-character checksum
(cr)
end-of-command character, character returns(0x0D)
Calculate Checksum:
1.
Calculate ASCII sum of all characters of command (or
response) string except the character returns(cr).
2.
Mask the sum of string with 0ffh.
Example:
Command string: $012(cr)
Sum of string = ‘$’+‘0’+‘1’+‘2’ = 24h+30h+31h+32h = B7h
The checksum is B7h, and [CHK] = “B7”
Command string with checksum: $012B7(cr)
Response string: !01300600(cr)
Sum of string: ‘!’+‘0’+‘1’+‘3’+‘0’+‘0’+‘6’+‘0’+‘0’
= 21h+30h+31h+33h+30h+30h+36h+30h+30h = 1ABh
The checksum is ABh, and [CHK] = “AB”
Response string with checksum: !01300600AB(cr)
s
t
e
S
d
n
a
m
m
o
C
l
a
r
e
n
e
G
d
n
a
m
m
o
C
e
s
n
o
p
s
e
R
n
o
i
t
p
i
r
c
s
e
D
n
o
i
t
c
e
S
F
F
C
C
T
T
N
N
A
A
%
A
A
!
n
o
it
a
r
u
g
if
n
o
C
e
l
u
d
o
M
t
e
S
1
.
2
.
c
e
S
2
A
A
$
F
F
C
C
T
T
N
N
A
A
!
n
o
it
a
r
u
g
if
n
o
C
d
a
e
R
2
.
2
.
c
e
S
5
A
A
$
S
A
A
!
s
u
t
a
t
S
t
e
s
e
R
d
a
e
R
3
.
2
.
c
e
S
F
A
A
$
)
a
t
a
D
(
A
A
!
n
o
i
s
r
e
V
e
r
a
w
m
ri
F
d
a
e
R
4
.
2
.
c
e
S
M
A
A
$
)
a
t
a
D
(
A
A
!
e
m
a
N
e
l
u
d
o
M
d
a
e
R
5
.
2
.
c
e
S
)
a
t
a
D
(
O
A
A
~
A
A
!
e
m
a
N
e
l
u
d
o
M
t
e
S
6
.
2
.
c
e
S