Hi there
I have a query tag setup with history enabled. I was then going to bind the data of a table to a tag history binding using the query tag history. Problem is I can only get it to return 4 rows, and the value row is empty. I'm sure I don't have something configured properly, most likely on the query tag, but I can't figure out what.
The query tag returns one row, with 4 columns. The database for this is on a machine. I set the history up to record to the Ignition sql database.
Maybe this isn't the right way? I really don't know where I'm going wrong here, any help is appreciated.
Thanks!
Can you post pictures of the History tab on the tag and the binding window on the table?
Sounds like you have the tag configured properly, but are using WIDE format return on the table instead of TALL.
Sure! Thanks for the quick reply.
Everything is correct for the bindings and the dataset is 185 rows.
you are saying it only shows 4 rows in the table?
Is it actually displaying?
Depending on how often that tag changes, you could be looking at one hell of a query against the historian asking for a month AsStored.
Cut that down to a day or a week and see if it renders?
I had it set shorter, I set it to a month to make sure I got every row stored just to see if there was something. I set it to a day(which considering I just started this today the return is the same as a month anyway) and this is what I get back.
What is the tag type?
And does the tag actually show a value?
That looks like it is storing a NULL for the value every minute, which is strange in itself as you have it set to Max 5 Minutes between and OnChange for storage.
It's a query tag. It may or may not show a value depending on if the machine is processing something or not.
I just changed the query to always return something, just to see if that is the problem. Didn't change anything though, but I know for a fact I have a dataset in the query tag now at least.
IA's historian doesn't support dataset tags. That you get anything at all is the surprise.
I was afraid of that. What do you think the solution would be? Write a script to insert the relevant columns into a table on the tag change event? Then do a named query to pull the data?
What is the original source of the data? Tags? If so, historize them individually. And, perhaps, use tag change events to capture the latest values to keep a scripted dataset up to date.
The original source is a db. I have a query tag setup to pul the data from a machine(no access to the plc directly), the machine deletes this data every day but we’d like to keep a record of it.
Set up a table in your own DB that matches the structure. Run a regular timer or scheduled event that copies that data to your DB directly, excluding rows already copied. No tags needed or desired.
I’ll have to look into how to do that exactly probably a gateway script that does a named query(update)? No, only supports one db connection I believe. Anyway, thanks for the replies and have a great holiday!
Separate named queries for retrieval from one and insert to the other.