Structure of the GEM Items Database

Fields 1 through 4 are common to all the record types within the GEM Items database. Refer to the information for the specific record types for the usage of fields 5 through 15.
Table 8-4. Structure of the GEM Items Database

Field Number
Variable

Field Name

(Sort Order)

Type
Size [Array]

Description

0
cc.name

Name

name
15

Name of the item.

1
cc.update

Update Date

date/time
4

The date/time this record was created or changed.

2
gm.f.desc

Description

string
72 [4]

Description of the item.
gm.asize.desc=4
Number of description lines

3
gm.f.menu=
cc.page.name

Menu page name

name
15 [2]

Name of the menu page (and file) used to display the item records. (Not currently used.)

4
gm.f.rec.type

Record Type
(1)

byte
1

Code indicating the type of GEM item (alarm, collection event, report, or state) that is described by the record. (See Values for Record Type Field.)

5

ID
(3)

integer
2


6

String

string
40


7

Spawn Name

name
15


8

Enable Flag

Boolean
1


9

Set Flag

Boolean
1


10

Integer 1
(2)

integer
2


11

Integer 2

integer
2


12

Integer 3

integer
2


13

Integer 4

integer
2


14

Real Value

real
4


15

Integer Array

integer
2 [20]


Notes:

- For fields 5 to 15, the field-number variables and the descriptions depend on the record type. See Tables 8-6, 8-7, 8-8, and 8-9.

- The routine gm.next.rec( ) assumes that the "Record Type" field is the primary sort field.

- Any code that accesses the database must consider the record type.

- The database must be kept sorted, so that all the records of each type are kept together.

- The secondary sort on "Integer 1" is intended to group the State records for each State Model.

Table 8-5. Values for Record Type Field

Name

Value

Description

gm.rec.ala

1

Record type for Alarm records.

gm.rec.col

2

Record type for Collection Event records.

gm.rec.rep

3

Record type for Report records.

gm.rec.sta

4

Record type for State records.

Structure of the Alarm Record Type

Structure of the Alarm Record Type details the field usage for the Alarm record type. See Structure of the GEM Items Database for more information about the fields.
Table 8-6. Structure of the Alarm Record Type

Field Number
Variable

Field Name

Description

5
gm.f.item.id

Alarm ID

ID number for the alarm (must be unique among all alarms). (ALID)

6
gm.f.al.text

Alarm Text

Text sent to host for the alarm. (ALIX)

7
gm.f.spawn

Action Sequence

AIM sequence to run when the alarm is set.

8
gm.f.enabled

Alarm Enabled

This flag is set to TRUE when the alarm is enabled.

9
gm.f.al.set

Alarm Set

This flag is set to TRUE when the alarm is set.

10


Not used.

11
gm.f.al.setevnt

Set Event

ID of the collection event performed when the alarm is set. (CEID)

12
gm.f.al.clrevnt

Clear Event

ID of the collection event performed when the alarm is cleared. (CEID)

13

gm.f.al.categor

Category

Alarm category reported to the host in the alarm code byte (ALCD). See the related note in The GEM Items Database.

14 & 15


Not used.

Note:

- Fields 1 through 4 are common for all GEM Items record types. See Structure of the GEM Items Database

Structure of the Collection Event Record Type

Structure of the Collection Event Record Type details the field usage for the Collection Event record type. See Structure of the GEM Items Database for more information about the fields.
Table 8-7. Structure of the Collection Event Record Type

Field Number
Variable

Field Name

Description

5
gm.f.item.id

Collection Event ID

ID number for the collection event (must be unique among all collection events). (CEID)

6 & 7


Not used.

8
gm.f.enabled

Collection Event Enabled

This flag is set to TRUE when the collection event is enabled.

9 to 14


Not used.

15
gm.f.data.ids

Report IDs

IDs of reports associated with this collection event. (RPID)
gm.asize.cerpts=20
Number of reports.

Note:

- Fields 1 through 4 are common for all GEM Items record types. See Structure of the GEM Items Database.

Structure of the Report Record Type

Structure of the Report Record Type details the field usage for the Report record type. See Structure of the GEM Items Database for more information about the fields.
Table 8-8. Structure of the Report Record Type

Field Number
Variable

Field Name

Description

5
gm.f.item.id

Report ID

ID number for the report (must be unique among all reports). (RPID)

6 to 14


Not used.

15
gm.f.data.ids

Report IDs

IDs of variables listed by this report. (VID)
gm.asize.rptvid=20
Number of Variable IDs.

Note:

- Fields 1 through 4 are common for all GEM Items record types. See Structure of the GEM Items Database.

Structure of the State Record Type

Structure of the State Record Type details the field usage for the State record type. See Structure of the GEM Items Database for more information about the fields.
Table 8-9. Structure of the State Record Type

Field Number
Variable

Field Name

Description

5
gm.f.item.id

State ID

ID number for the state (must be unique among all the state records).

6


Not used.

7
gm.f.spawn
Action Spawn Routine Name of the V+ routine to be executed when the state is entered.
8 & 9
Not used.

10
gm.f.stt.varbl

State Variable

Variable ID for the State variable associated with the state. This is used as a secondary sort field so that all records for a Control model will be grouped together.

11
gm.f.stt.actvar

Action Variable

Variable ID for the variable to change upon entry to the state.

12
gm.f.stt.actce

Action Collection Event

ID of the Collection Event performed when the state is entered.

13
gm.f.stt.actalm

Action Alarm

ID of alarm set when the state is entered.

14
gm.f.stt.actval

Action Value

Value to assign to the action variable.

15


Not used.

Note:

- Fields 1 through 4 are common for all GEM Items record types. See Structure of the GEM Items Database.