Integrate Ignition with Tiger Cloud
Connect Ignition SCADA to Tiger Cloud and store tag history
Ignition is a SCADA system used to connect data, design industrial systems, and monitor automated processes in real time.
This page shows you how to connect Ignition to your Tiger Cloud service to stream industrial data into Tiger Cloud.
Prerequisites for this integration guide
To follow these steps, you'll need:
-
These steps use Tiger Cloud, but the same approach applies to a self-hosted TimescaleDB instance.
- Your connection details.
- An Ignition instance with admin access
Create a Tiger Cloud service connection in Ignition
Section titled “Create a Tiger Cloud service connection in Ignition”- Sign in to the Ignition Gateway
Navigate your browser to the Ignition Gateway screen and sign in with an admin account. Open
Connections>Database Connectionsand selectCreate Database Connection +. - Select the PostgreSQL driver
Select
PostgreSQLas the driver (included in every standard Ignition install). - Configure the database connection
- Give the database connection a name.
- Add the
username,password, andconnection urlusing your Tiger Cloud service connection details. - Select
Create Database Connection.
- Verify the connection
Verify that the database connection was created and status is valid. If any errors appear, consult the Ignition manual.
Set up your Tiger Cloud service as a historian
Section titled “Set up your Tiger Cloud service as a historian”- Create a historian
On the Ignition Gateway, select
Services>HistoriansandCreate Historian +. - Select SQL Historian
Select
SQL Historian. - Name the historian and disable partitioning
Add a name for the historian, and select the Tiger Cloud service database connected in section 1 as the Data Source. Disable Partitioning.
- Verify the historian is running
Verify the new historian is enabled and running.
- Start data flowing into the historian
Before proceeding to the next section, make sure there is data flowing into the historian. This can be done by creating any tag and setting
History EnabledtoTrue. That will guarantee that the historian table is created.
Ignition will automatically create the table in Tiger Cloud service, but will not set it up as a hypertable. The following instructions can be performed within Ignition's SQL Editor, the Tiger Console, or any other SQL editor.
Optimize for Ignition workloads
Section titled “Optimize for Ignition workloads”- Convert the auto-created historian table to a hypertableSELECT create_hypertable('sqlth_1_data','t_stamp',migrate_data => 'true',chunk_time_interval => 86400000);
- Tell TimescaleDB what the current time is
Ignition stores
t_stampas a Unix epoch timestamp in milliseconds, not as a PostgreSQLtimestamp. Automated jobs such as columnstore and retention policies work out the age of each chunk relative to the current time, so you must tell TimescaleDB how to read "now" for this integer column withset_integer_now_func. The function must return milliseconds to matcht_stamp:CREATE OR REPLACE FUNCTION unix_now_ms() RETURNS BIGINTLANGUAGE SQL STABLE AS $$ SELECT (extract(epoch from now()) * 1000)::BIGINT $$;SELECT set_integer_now_func('sqlth_1_data', 'unix_now_ms'); - Optional: enable the columnstore and add a policy
Because
t_stampis an integer column, the policyafterargument is a number of milliseconds rather than anINTERVAL. For example,604800000is 7 days:ALTER TABLE sqlth_1_data SET (timescaledb.enable_columnstore = true,timescaledb.segmentby = 'tagid',timescaledb.orderby = 't_stamp DESC');SELECT add_columnstore_policy('sqlth_1_data', after => 604800000); - Optional: add retention policy
As with the columnstore policy,
drop_afteris a number of milliseconds. For example,31536000000is 365 days:SELECT add_retention_policy('sqlth_1_data', drop_after => 31536000000);
You have successfully integrated Ignition with Tiger Cloud.