Historical Replay / Simulation System

Hey all!

I have recently purchased the Ignition SQL Bridge module with hopes and dreams of setting it up to log process variables on an existing system… and then “replay” those values back into a controllogix processor to simulate the realtime process in the PLC.

I have a laptop with Ubuntu 12.04, latest & licensed version of Ignition SQL Module, and PostgreSQL talking to my Controllogix over EtherNet/IP.

Here’s where I’m at so far. So far… I’m just logging 1 real value using a Historical Group using timestamps. From there, I’ve created a SQL query tag that polls the database at a specified interval and writes a value back to the PLC.

SQL TAG Query:
WHERE t_stamp >= NOW()- ‘{[~]ReplayDateDiff}’::INTERVAL
ORDER BY t_stamp ASC

HIST_PV is the column where I’m storing data. ReplayDateDiff is the tag where I’m storing my time span difference.

Now I need to do this for about ~400 tags and want to make sure that I get it right before I deploy this system to collect.

It seems like my approach is going to be tedious to configure, but I don’t know how else to do it. Do any of you have any suggestions for better ways to do this?

There are a couple ways to get a value at a specific time, but most will be pretty tedious. You could use the SQLTags Historian to do it, that system will take in a time range and an interval for the Sample Size. Once you have your list of tags you can call system.tag.queryTagHistory() (or just use a SQLTag History binding on a dataset) to get the values you want with the right interval.