Rice Lake 920i Installation Manual V4.0 User Manual

Page 103

Advertising
background image

Serial Commands

97

Example.

The following commands place the data

shown in Table 9-15 into the first database in the
onboard memory:

DB.DATA.1#0=this|<CR>
DB.DATA.1#0=is|<CR>
DB.DATA.1#0=a|<CR>
DB.DATA.1#0=test<CR>

DB.DATA.1#0=aaa|<CR>
DB.DATA.1#0=bbb|<CR>
DB.DATA.1#0=ccc|<CR>
DB.DATA.1#0=ddd<CR>

Table 9-15. Sample Database Contents

Record

Cell

1

2

3

4

first

this

is

a

test

second

aaa

bbb

ccc

ddd

Sending the

DB.DATA

command alone, without

assigned data, returns the database contents:

DB.DATA.n#x<CR>

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<CR>

If the database contents are the records shown in
Table 9-15, 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. The time-out
value will 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.

NOTE: The 62K of onboard (slot 0) memory can be allocated
to up to eight auxiliary databases. However, the size of any
one database may limit the size and number of other
databases.

DB.SCHEMA

The

DB.SCHEMA

command is used to get or set the

structure of a database.

DB.SCHEMA.n#x<CR>

The

920i

responds to the command above by returning

the following:

<Max Records>,<Current Record Count>,
<Column Name>,<Data Type>,<Data Size>
,...<CR>

The

<Column Name>

,

<Data Type>

, and

<Data Size>

elements repeat for each column in the database.

The

<Column Name>

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

<Data Type>

is represented by a numeric field:

Table 9-16. Data Type Field Codes

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

The

<Data Size>

value must match the data type. A

range of data size values is allowed only for the
string data types:

Table 9-17. Data Size 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

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.

Advertising