Csv Formats - VideoLogic Proteus-V User Manual

Table of Contents

Advertisement

CSV
FORMATS
A CSV is an ASCII sentence composed of a unique header, followed by up to 12 comma separated values and a checksum.
$Header,VAL1,VAL2,VAL3,VAL4,VAL5,VAL6,VAL7,VAL8,VAL9,VAL10,VAL11,VAL12*CS
$
Signifies start of the sentence.
Header
Sentence header. Follow
VALn
Each sentence contains multiple values (VALn) delimited by commas.
*
The asterisk serves as checksum delimiter.
CS
The checksum field contains two ASCII characters which indicate the hexadecimal value of the checksum.
PROTEUS supports 4 different CSV (Comma Separate Values) and 2 different SSV (Space Separate Values) sentences:
Type
Sentence includes
CSV1
$Header, Values..., Checksum
CSV2
$Header, Values...
CSV3
$Values,..
SSV3
$Values ...
CSV4
Values,...
SSV4
Values ...
Upon reception of a CSV sentence and confirmation of the sentence header (only CSV1), PROTEUS parses the sentence. Parsed values (VAL1 ... VAL12)
are sequentially stored in
Registers
length, but each
VALn
is limited to 40 characters or less.
For more detail on how to use CSV sentences, see
Display values
from csv sentence
The checksum field is the last field in a sentence and follows the checksum delimiter character "*". The checksum is the 8-bit exclusive OR of all characters
in the sentence, including "," delimiters, between but not including the "$" and the "*" delimiters. The hexadecimal values of the most significant and least
significant 4 bits of the result is converted to two ASCII characters (0-9, A-F (upper case)) for transmission. The most significant character is transmitted
first. Example:
$GPGLL,5057.970,N,00146.110,E,142451,A*27<CR><LF>
In C checksum computation would be written as:
char sentence [] = "GPGLL,5057.970,N,00146.110,E,142451,A";
int i;
char checksum = 0;
for ( i = 0; i < strlen(sentence); i++)
checksum ^= sentence[i];
Although not recommended, for CSV1 type sentences, checksum computation can be bypassed by replacing CS with XX.
Figure 1-2
to define your unique sentence header.
Sentence Structure
$HEADER,VAL1,VAL2,VAL3,...VALn*CS
$HEADER,VAL2,VAL3,...
$VAL1,VAL2,VAL3,...
$VAL1 VAL2 VAL3 ...
VAL1,VAL2,VAL3,..
VAL1 VAL2 VAL3 ..
# 40 through 87. Any widgets linked to these registers will automatically get updated. CSV sentences vary in
Display text via RS232
Example
$STEVE,45,315,200,100*XX
$BRIAN,45,315,200,100
$45,315,200,100
$45 315 200 100
45,315,200,100
45 315 200 100
8
Location of parsed VALn
In sentence A,B,C,D
In sentence A,B,C,D
In sentence A
In sentence A
In sentence A
In sentence A

Advertisement

Table of Contents
loading

Table of Contents