Skip to content

5. Database Communication

After enabling database communication and turning on the automatic data collection task for the target machine/group (see the Bivrost Gateway Manual 5.3.1.2. Task Settings, and 5.4.1.2. Group Task Settings), the gateway will automatically write the data collection task results to the specified database. Currently supported database types include InfluxDB v2.x, MySQL, SQL Server, PostgreSQL, and others. Refer to the Bivrost Gateway Manual 5.6.4. Database Configuration for instructions on configuring the database service.

Database table names take the form [table prefix][data class], where the table prefix is set on the gateway’s communication configuration page (see the Bivrost Gateway Manual 5.6.4. Database Configuration); the table name is the same as the type of the data class used in MQTT communication (see 1.2. Data Description). The table below shows the names of each database table (using a MySQL database with no table prefix set and log storage mode as an example):

Table Name Data Class
alarmhistory AlarmHistory
alarmlog AlarmLog
axialoverload AxialOverload
cncstatus CNCStatus
count Count
currenttoolnumber CurrentToolNumber
cycle Cycle
energyconsum EnergyConsum
feed Feed
feedandspindle FeedAndSpindle
groupcount GroupCount
groupcumulativetime GroupCumulativeTime
groupoee GroupOEE
laserpower LaserPower
load Load
loghistory LogHistory
machine — (Machine information table)
oee OEE
offset Offset
plc PLC
position Position
programblock ProgramBlock
programinfo ProgramInfo
spindleoverload SpindleOverload
timedata TimeData
toollife ToolLife

The fields in each database table are the same as the tags and fields of the corresponding data class type (see 1.2. Data Description). The table below shows the fields of the cncStatus table (using a MySQL database with no table prefix set and log storage mode as an example):

# Name Data Type Length/Decimal Point
1 cncStatus TEXT
2 adjustedStatus TEXT
3 alarmStatus TEXT
4 alarmLevel TEXT
5 offTime BIGINT 20
6 waitTime BIGINT 20
7 emergencyTime BIGINT 20
8 autoRunTime BIGINT 20
9 manualTime BIGINT 20
10 channel VARCHAR 128
11 machineID VARCHAR 128
12 time DATETIME 3
13 uid VARCHAR 128