Rice Lake 920i Installation Manual V2.0 User Manual
Page 91
Serial Commands
87
Example.
The following commands place the data
shown in Table 9-13 into the Þrst database in the
onboard memory:
DB.DATA.1#0=this|
DB.DATA.1#0=is|
DB.DATA.1#0=a|
DB.DATA.1#0=test
DB.DATA.1#0=aaa|
DB.DATA.1#0=bbb|
DB.DATA.1#0=ccc|
DB.DATA.1#0=ddd
Sending the
DB.DATA
command alone, without
assigned data, returns the database contents:
DB.DATA.n#x
The
920i
responds with the entire contents of the
database. Returned data is cell-delimited with the pipe
character (ASCII 124) and row-delimited with
carriage returns (ASCII 13).
For example, the following command could be used to
return the contents of database 1 in the onboard
memory:
DB.DATA.1#0
If the database contents are the records shown in
Table 9-13, the indicator responds with the following
data, using pipe characters and carriage returns to
delimit the database cells and rows, respectively:
t h i s | i s | a | t e s t < C R > a a a | b b b | c c c | d d d < C R >
NOTE:
There is no end of database notification at the
end of the DB.DATA
command
transmission. Use a
receive time-out to determine command completion. This
time-out should vary based on baud rate.
You should determine the number of records currently
in the database both prior to and after sending the
DB.DATA
command to verify that the correct number of
records are received. The number of records can be
determined with the
DB.SCHEMA
command.
DB.SCHEMA
The
DB.SCHEMA
command is used to get or set the
structure of a database.
DB.SCHEMA.n#x
The
920i
responds to the command above by returning
the following:
The
,
, and
elements repeat for each column in the database.
The
follows the rules for alias
names: 8 character maximum; must begin with an
alpha character or an underscore; can only contain
AÐZ, aРz, 0Р9, or an underscore (_).
The
is represented by a numeric Þeld:
The
value must match the data type. A
range of data size values is allowed only for the
string data types:
The
DB.SCHEMA
command can also be used to modify
the schema, but only when the indicator is in setup
mode and only if the database does not contain any
data.
Record
Cell
1
2
3
4
first
this
is
a
test
second
aaa
bbb
ccc
ddd
Table 9-13. Sample Database Contents
Value
Type
1
Byte
2
Short (16-bit integer)
3
Long (32-bit integer)
4
Single (32-bit floating point)
5
Double (64-bit floating point)
6
Fixed string
7
Variable string
8
Date and time
Table 9-14. Data Type Field Codes
Size
Value
Byte
1
Short
2
Long
4
Single
4
Double
8
Fixed string
1–255
Variable string
1–255
Date and time
8
Table 9-15. Data Size Field Codes