Form a data table with data from DB

Hello all,

I am trying to get data for a tag at a certain step in the process. Is there any way we can do this without using SQL ? If not then how would I go about joining all the data between the partitions.

Problem statement:
I want to find the weight scale value at current step = 53 for my process for last 6 months.

If someone can help me find a solution it would be great. I am not familiar with SQL.

Thank You in Advance !

Is there any way we can do this without using SQL?

If the data is an SQL database then you need to use SQL.

If not then how would I go about joining all the data between the partitions.

Do you mean Ignition's Historian partitions. Was the data saved with Ignition's Historian?

Yes, data was saved using ignition’s historian

Then you retrieve the data using Ignition's system.tag | Ignition User Manual functions and, probably, system.tag.queryTagHistory | Ignition User Manual. These functions handle partitioning automatically.

I suggest that you learn how the history has been stored.

  • Create a view with a table in it.
  • Create a binding on the table's data property.
  • Select "Tag History Binding".

Play around with this, having a look at the returned data displayed in the table.
When you understand the returned data then you can start thinking about writing a script to get the data into the format you want.

Indeed.

And you will likely need to create a script that makes multiple scripted history queries. Something like:

  • Gather all of the raw data for the trigger tag over the whole time period,
  • Loop through that collecting the start,end timestamps for the inner time periods, then
  • query for all of the tags of interest for each inner time period.
  • Do something with all of the data...