2 information message output – Campbell Scientific SR50A Distance Sensor User Manual

Page 21

Advertising
background image

SR50A Sonic Ranging Sensor

VXVVV
If X is a 1, then no watchdog errors have occurred.

VVXXX
The 3 digits XXX are for factory use and should always read 111.

CC
This is a 2 character checksum of the data packet. The checksum is the two’s
complement of the data packet sum including control characters.

The Least significant byte is used resulting in a 2 character checksum.

<STX> = &h02 (Hexadecimal)

<CR> = &h0D (Hexadecimal)

<LF> = &h0A (Hexadecimal)

<ETX> = &h03 (Hexadecimal)

The following is a sample packet with proper checksum:

<STX>33;1838;194;11011;2C<CR><LF><ETX>
SUM

=

02+33+33+3B+31+38+33+38+3B+31+39+34+3B+31+31+30+31+31
+3B+0D+0A+03
=0x3D4

Use Last byte only (D4) and calculate two’s complement = 100 – D4 = 2C

<CR>
Carriage return character. 0x0d in hexadecimal or 13 in decimal

<LF>
Line feed character. 0x0a in hexadecimal or 10 in decimal

<ETX>
End of transmission character. 0x03 in hexadecimal or 3 in decimal

3.8.2 Information Message Output

The measurement output string for the SR50A is as follows:

<STX>aa;SSSSS;H.H;F.F;BBBBB;WWWWW<CR><LF><ETX>

<STX> is the hex character 0x02 (2 in decimal)

aa
These two characters are the serial address of the sensor. The default is 33.
Note this is two ASCII characters of 0x33 in Hexidecimal or 51 in decimal.

SSSSS
This is the serial number of the sensor

H.H
This is the hardware version of the sensor

F.F
This is the firmware version of the sensor

15

Advertising