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 DatabaseField Number
VariableField Name
(Sort Order)
Type
Size [Array]Description
0
cc.nameName
name
15Name of the item.
1
cc.updateUpdate Date
date/time
4The date/time this record was created or changed.
2
gm.f.descDescription
string
72 [4]Description of the item.
gm.asize.desc=4
Number of description lines3
gm.f.menu=
cc.page.nameMenu 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.typeRecord Type
(1)byte
1Code 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
26
String
string
407
Spawn Name
name
158
Enable Flag
Boolean
19
Set Flag
Boolean
110
Integer 1
(2)integer
211
Integer 2
integer
212
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.
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 TypeField Number
VariableField Name
Description
5
gm.f.item.idAlarm ID
ID number for the alarm (must be unique among all alarms). (ALID)
6
gm.f.al.textAlarm Text
Text sent to host for the alarm. (ALIX)
7
gm.f.spawnAction Sequence
AIM sequence to run when the alarm is set.
8
gm.f.enabledAlarm Enabled
This flag is set to TRUE when the alarm is enabled.
9
gm.f.al.setAlarm Set
This flag is set to TRUE when the alarm is set.
10
Not used.
11
gm.f.al.setevntSet Event
ID of the collection event performed when the alarm is set. (CEID)
12
gm.f.al.clrevntClear 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 TypeField Number
VariableField Name
Description
5
gm.f.item.idCollection Event ID
ID number for the collection event (must be unique among all collection events). (CEID)
6 & 7
Not used.
8
gm.f.enabledCollection Event Enabled
This flag is set to TRUE when the collection event is enabled.
9 to 14
Not used.
15
gm.f.data.idsReport 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 TypeField Number
VariableField Name
Description
5
gm.f.item.idReport ID
ID number for the report (must be unique among all reports). (RPID)
6 to 14
Not used.
15
gm.f.data.idsReport 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 TypeField Number
VariableField Name
Description
5
gm.f.item.idState ID
ID number for the state (must be unique among all the state records).
6
Not used.
7
gm.f.spawnAction Spawn Routine Name of the V+ routine to be executed when the state is entered. 8 & 9 Not used. 10
gm.f.stt.varblState 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.actvarAction Variable
Variable ID for the variable to change upon entry to the state.
12
gm.f.stt.actceAction Collection Event
ID of the Collection Event performed when the state is entered.
13
gm.f.stt.actalmAction Alarm
ID of alarm set when the state is entered.
14
gm.f.stt.actvalAction 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.