Siemens XT55 사용자 설명서

다운로드
페이지 20
XT55 AVL Software Instructions User’s Guide 
Confidential/Preliminary 
s
 
m
o
 
b
 
i
 
l
 
e
 
XT55_avl_ug_V01 
Page 14 of 20 
15.03.2004 
3.1.1 Extended NMEA Commands – for XT55 only 
3.1.1.1 Command Syntax 
The XT55 module accepts NMEA commands in the following formats: 
 
$PSRF<command>,<parameter>, .. ,<parameter><* Checksum><CR> <LF>. 
 
 
Command
1
 
Parameter
2
 
Checksum
3
 
End Sequence 
$PSRF11 
Data 
*CKSUM 
<CR> <LF> 
 
1
 
NMEA command 
2
 valid parameters 
3
 the checksum consists of a “*” followed by two hex values. In order to calculate the Checksum, use 
your own application, which calculates the Checksum. Below a small source code is written in Visual 
Basic: 
 
Public Sub CheckSum(field As String) 
  If field = “” then 
   CS = “*” 
    CS = 0 
     For i = 1 to Len(field) 
      CS = CS Xor Asc(Mid$(field, i, 1)) 
      Next 
     CS = Hex(CS) 
    If Len(CS) =1 then  
   CS = “0” & CS 
  CS = “*” & CS 
 END SUB 
 
Therefore, the string over which the checksum has to be calculated is (see example below): 
field = PSRF112,21 //without the character “$”  
 
Example: 
$PSRF112,21*0A 
 
Command 
Parameter 
Checksum 
End Sequence 
$PSRF112, 
21 
*0A 
<CR> <LF>