With FTV SE we usually create external reports using SSMS with the SQL Express DB that we log tags to for trending.
Is any reporting available at all through Ignition without the Reporting Module?
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)?
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.
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.
Despite the name, the “internal historian” does not actually store data inside Ignition’s internal DB. Also, it requires the tag historian module.
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?
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)
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.
In the end it turned out not to be so bad doing data logging and trending without the tag historian module.
Create a DB and table using MS SQL Express (or your preferred DB)
Add DB connection to the gateway
Set default DB for the project
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
Add gateway startup script to call named query 4a
Add project as Gateway Scripting Project
a. Define logging script in Gateway Scripting Project
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
Create an easy chart and use DB pens instead of tag pens
a. Use the where clause to match to the PLC tag