Displaying historical tag information in numeric label

Good evening all

I’m very new to Ignition. I am converting a RSview32 application to Ignition. I am trying to display a tag’s history on the display as a numeric label. I need to do this for 36 total times to basically build a 3-hour historical display on the screen. I also need to do an average of these values and display it. I want to have the displays basically update each time the data is updated by the tag history period. I know the tables are the easiest way to display data this way, but I want to recreate the old display as it is what they are used to seeing. I can definitely do this in the PLC, but I figured since Ignition is building the database for me I should be able to read it easily.

Vision or perspective? And what version?

You can easily pull this data with the historian in the exact format you want. If you don’t mind it being displayed in a table, that will be the easiest way to display the 3 hour historical values in 5 minute intervals. The average would be displayed separately. If you don’t want the 5 minute intervals in a table, then it will be more work but still possible.

1 Like

My thoughts were similar. However if Vision, then use a template repeater to emulate the labels from the dataset created.nif perspective use a flex repeater.

I'd run a gateway timer script to pull the data and push it into a dataset tag that the *repeater would be bound to and viola data.

1 Like

We are running Ignition 8.1 and vision 11.1

Either @michael.flagler or my suggestion is viable in that environment.

Do you have a specific part that you are stuck on?

Good evening all

Sorry to get back late I got stuck on a 2 week install and got pulled in one of my 45 other directions. I did figure out how to get a data table attached to a numeric display and do an average from that data. This will work for display purposes no problem. Ideally, I would like to get that average value that is bound in the numeric display property tied to a tag that I can reference in other parts of the project. I think it should be a tag history query with simple average aggregation. I have tried the manual for that function, but I am definitely having a syntax problem. SQL and Python are very new to me and training from work is non-existent to be honest.

Post the code, show us what you are trying and we can help.

Please see Wiki - how to post code on this forum.

Based in the online manual and sample code I wanted to do the following to grab a rolling 3 hour dataset from the historian to store in a tag as a dataset. I also want to grab a simple average of the same data as a separate tag as well. My understanding is if I add an aggregationmode=simpleAverage modifier below I should get a simple average of the last 36 data points in this dataset.

endTime = system.date.now()
startTime = system.date.addMinutes(endTime, -180)
dataset = system.tag.queryTagHistory(paths=['Oxidizer_Combustion_chamber_temp'], startDate=startTime, endDate=endTime, returnSize=0, returnFormat='Wide')