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.
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?
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?
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