Ignition Logging, Reporting, and Trending Options

Looking at reporting options.

With FTV SE we usually create external reports using SSMS with the SQL Express DB that we log tags to for trending.

  1. Is any reporting available at all through Ignition without the Reporting Module?

  2. Is there a way to pull the data out of the internal database and more-or-less copy the data into our own SQL Express DB (or use it directly) to do the same (i.e. make external reports)?

  3. Is either the Tag Historian or SQL Bridge module required to get data into an external database, or is there some other way to access this data?

First, you do not need the SQL Bridge or Historian modules to query data. You can kind of fake a report using the tools available in vision or perspective, but it will be limited. I don’t know about messing with the internal database, but you can query a database and then insert that data into another database.

Check out system.db, very powerful tools.
https://docs.inductiveautomation.com/display/DOC81/system.db

Database actions can be entirely scripted without those modules. Trending also becomes very manual. No Perspective Power Chart, no tag pens in Vision's EasyChart.

Does the internal Tag Historian not work for trending?

Despite the name, the “internal historian” does not actually store data inside Ignition’s internal DB. Also, it requires the tag historian module.

1 Like

Is there documentation for database actions and trending without Tag Historian? (using Vision)

Start with @josborn’s link.

Then this for bindings (among others):

https://docs.inductiveautomation.com/display/DOC81/Named+Query+Bindings

Then this for charting, keeping in mind that you cannot use tag historian bindings nor EasyChart tag pens:

https://docs.inductiveautomation.com/display/DOC81/Vision+-+Charts+Palette

Consider also going through Inductive University.

Thanks. This looks like everything I would need.
I have gone through Inductive University and have both Core and Gold certificates.

I noticed that you mentioned creating your own module in another post asking questions about similar topics. I’ve not looked into anything about creating a module. Could you point me in the right direction to start looking into that?

Brace yourself. Start here:

Then follow the SDK link near the bottom of the sidebar of the online docs. Follow IA’s github repos.

A somewhat rambling primer to the concepts, if you're not familiar with Java development:

Am I able to use the Database Connection defined in the gateway configuration page without a specific module? (i.e. I want to make a query tag and need a datasource)

Yes. “Raw” database connections, and their use through scripting (system.db functions), and named queries, are all “platform” features.

3 Likes

Ok, so I think I understand what I need to do.
Getting data out of Ignition and into an external database isn't too hard. Instead of configuring Tag History for each tag I'll use a Tag Change script and use scripting to log it into the database.

Then, to do trending I'll need to pull from this database.
Historical trending seems relatively straightforward, however I'm having trouble thinking about how to handle queries for realtime trends. Any insights?

You just re-run the query that has bounds including now() every so often (the easy chart typically queries once per second). Note, you can use the EasyChart’s DB pens.

1 Like

In the end it turned out not to be so bad doing data logging and trending without the tag historian module.

  1. Create a DB and table using MS SQL Express (or your preferred DB)
  2. Add DB connection to the gateway
  3. Set default DB for the project
  4. Create 3 named queries for call in scripting (system.db.runNamedQuery())
    a. Create the table if it does not already exist in the DB (gateway called via gateway startup script)
    b. Get the latest tag value from the DB
    c. Store new tag value to the DB
  5. Add gateway startup script to call named query 4a
  6. Add project as Gateway Scripting Project
    a. Define logging script in Gateway Scripting Project
  7. Add tag event value changed script to tags of interest (ideally, apply to UDT(s))
    a. I added custom properties to enable/disable logging and an adjustable deadband
    b. I strip out the PLC tag from the OPC item path for use as the “tag id” in the DB
    c. Check the current value vs the latest value in the DB and update DB as required
  8. Create an easy chart and use DB pens instead of tag pens
    a. Use the where clause to match to the PLC tag