Senseforce 2.0 Manual
  • Welcome to Senseforce 2.0
  • SF MQTT API
  • SF Edge
    • Edge Package Overview
    • Edge Installation
      • Using the SF Edge Service installer in command shell
      • Headless SF Edge Servie execution
    • Edge Configuration
      • Which Plugins to load (appsettings.xml)
      • Edge Data Routing (EventDefinition.xml)
      • OTA configuration (otasettings.xml)
      • Edge Logging
      • Input plugins
        • SQL Plugin
        • SQLite Plugin
        • OPC UA Plugin
          • OPC UA server browser
        • SIEMENS S7/SINUMERIK Plugin
          • Creating connection definition file
        • S7 Plugin
        • REST Plugin
        • TCP Listener Plugin
        • XML File Parsing Plugin
        • Heidenhain Plugin
      • Output Plugins
        • MQTT Plugin
        • SQLite Plugin
    • Edge Compute plugins
      • Creating compute plugins
      • Using compute plugins
  • SF Edge Asset Management
    • Edge version repository
  • SF Platform
    • Navigation
      • Overview Screen
    • Dataset Builder
      • Filters, Aggregations and Groupings
      • Functions of the Formula Editor
      • Additional Settings
      • Special Events
      • FAQ and Troubleshooting
    • Script Editor
      • Details of the Script Editor
      • Installed Packages
      • Working with Timestamps
        • Working with Timestamps in Python
        • Working with Timestamps in R
      • FAQ and Troubleshooting
    • Widgets
      • Text
      • Headline
      • Image
      • Progress Bar & Gauge Chart
      • Table
      • Map
      • Line, Bar, Scatter and Area Chart
      • Pie Chart
      • Gantt Chart
      • Histogram
      • Overview
      • Log
      • Default colors and color conditions
      • FAQ and Troubleshooting
    • Dashboards
      • Dashboard Filters
      • Favorites
      • Data Drilldown & Widget Interaction
      • Editing multiple dashboard widgets
      • Time Zones
      • Synchronized Zooming
      • Sharable Dashboard URL
      • Multi-chart layout options
      • Default sort for table widgets
      • Releases
      • Reporting
      • FAQ and Troubleshooting
      • Applying zoom to global timestamp filter
      • Optimise the layout for different devices
    • Machine Master Data
      • Dimensions
      • Instances
      • Things
      • Use Case
      • FAQ and Troubleshooting
    • Automation
      • Trigger
      • Scheduling overview
      • Actions
      • Test your Automation
      • Zapier integration (necessary internal steps)
      • Zapier integration
      • Subscriptions
      • FAQ and Troubleshooting
    • Event Schema Management
      • Importing a Event Schema
      • FAQ and Troubleshooting
    • Virtual Events
      • Creating a Virtual Event
      • Scheduling Overview
      • Permissions and Data Access
      • FAQ and Troubleshooting
    • Details modal for elements
    • Copy / Duplicate elements
    • Whitelabeling
    • Edge Device Management
    • Element History
    • Public API
      • Get your access token
      • Endpoints
      • Debugging scripts
      • FAQ and Troubleshooting
    • User & Group Management
      • FAQ and Troubleshooting
    • Active Directory & SSO Setup
Powered by GitBook
On this page
  • Configuration
  • Mandatory settings
  • Sample configuration
  • Advanced Settings
  • Sample file

Was this helpful?

  1. SF Edge
  2. Edge Configuration
  3. Output Plugins

SQLite Plugin

With our SQLite output plugin, data can be stored in a local or remote SQLite database. This allows for implementing high-frequency and edge-only data collection use-cases as well as storing the data locally only without connecting to the internet. Transferring the SQLite database to a remote computer with an internet connection allows transmiting the data to our cloud afterward.

A ring-buffer setting allows limiting the maximum amount of data stored locally to prevent disc overflow.

File location:

configs/configurations/OutputPlugins/Sqlite/SqliteSettings.xml

Configuration

Mandatory settings

The following settings are mandatory for running the SQLite output plugin

Setting

Description

DataSource

Filepath (with filename) pointing to the SQLite database file

RingBufferTableName

Specify the table which is used for implementing the ring-buffer. Remove this setting, if no ring-buffer behavior is desired.

AutoIncrementColumn

Name of a column in the SQLITE ringbuffer table. Use an INT autoincrement column for this.

The SQLite database as well as the desired table need to be available on startup. Senseforce Edge does not create a new database or a new table.

Use the EventDefinition.xml (Data Routing Definition) to define in which tables as well as which columns the data should be inserted.

Sample configuration

A sample MQTT plugin configuration is illustrated below

<?xml version="1.0" encoding="utf-8" ?>
<SqliteConfiguration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                     xsi:schemaLocation="https://senseforce.io/ ..\..\Schemas\sqliteoutsettings.xsd" >
  <SqliteServer>
    <!--Path to db or ":memory:"-->
    <DataSource>C:\Sqlite\testdb.db</DataSource>
    <!--Represents the connection modes that can be used when opening a connection.
    Valid values: ReadWriteCreate, ReadWrite, ReadOnly, Memory-->
    <Mode>ReadWrite</Mode>
    <!-- Represents the caching modes that can be used when creating a new Connection.
    Valid values: Default, Private, Shared-->
    <Cache>Shared</Cache>
  </SqliteServer>

  <!--Messages arriving from ingress plugins are batched until the NumberOfMessagesToCombine is reached or the MessageCombineCounterMs are elapsed. Then they are sent.-->
  <NumberOfMessagesToCombine>40000</NumberOfMessagesToCombine>
  <MessageCombineCounterMs>60000</MessageCombineCounterMs>

  <!-- Ringbuffer configuration-->
  <!-- Defines, which column is used as autoincremental column. Mandatory for ringbuffer to work-->
  <AutoIncrementColumn>rId</AutoIncrementColumn>
  <!-- Total length (number of rows) of ringbuffer -->
  <RingBufferLength>60000</RingBufferLength>
  <!-- Defines, which table is used as ringbuffer. Only one table can be configured as ringbuffer-->
  <RingBufferTableName>MDE100</RingBufferTableName>

  <!--Specify file for logging-->
  <Logger>
    <FilePath>$(LunaAppDataPath)Logs</FilePath>
    <FileName>SQLiteOut.log</FileName>
    <!--LogLevel: Debug,Information,Warning,Error,Critical,None-->
    <LogLevel>Debug</LogLevel>
  </Logger>
</SqliteConfiguration>

Advanced Settings

The following settings are available: (Note: the corresponding line in the above sample file is provided in brackets).

Setting

Description

Mode

File opening mode. Use ReadWrite or ReadWriteCreate

Cache

Represents the caching modes that can be used when creating a new Connection. Valid values: Default, Private, Shared

NumberOfMessagesToCombine MessageCombineCounterMs

Messages arriving from ingress plugins are batched until the NumberOfMessagesToCombine is reached or the MessageCombineCounterMs (milliseconds) are elapsed. Then they are sent. Setting higher values reduces bandwidth if the transmitted messages are compressed.

Note: SQLite is very fast when inserting huge batches of data.

RingBufferLength

Defines the size of the ringbuffer implementation

Sample file

PreviousMQTT PluginNextEdge Compute plugins

Last updated 3 years ago

Was this helpful?

2KB
SqliteSettings.xml
SqliteSettings.xml