I am new to Ignition, and working with SCADA in general, and would like some pointers on good ways to approach a report i would like to build.
In the ControlLogix for one of our paint lines i have accumulating counts (using DINT not COUNTER) for skid throughput per job and shift, that get reset at 2AM. Want to do history for those for previous week. Our IT department has not set us up with a SQL database to use yet, so limited to SQLite. Was originally going to do a transaction group to save values to DB at 1:30AM, after production has finished but before daily reset, but having trouble with getting timestamp to show as a date, and with figuring out how to structure the data in the table to arrive at the report view desired (shown in attached excel). Not sure if i can use tag history, since COS would have a new data point at every increment instead of just the total, and i cannot tell it to only store between 1:30AM-2AM. Maybe create a new set of DINTs in PLC that just get written to at that time with the daily total?
Also not sure it is even possible or how to go about designing the report to display like that in Ignition. Any pointers greatly appreciated. I am very limited on my knowledge of Python, so any solutions involving scripting i may have some trouble understanding.
This is the approach I would recommend. Your end goal, I think, is a bar chart in the report that uses stacked bar charts to display multiple value columns per shift (2 per day), over a length of time. The TX group would store the 4 value columns along with: an identifier for the day + an identifier for the shift. (To add custom values to the TX group you can add expression tags/items that evaluate to the values you want, for example you could have an expression doing a calc to find the previous day if the group runs at 1:30 AM)
This may be possible to do without any Python, Python can be helpful after a query in reporting to alter the dataset to fit the chart format. With proper ordering I think you could go from TX group > that bar chart format, but I am not sure what the x-axis labels would look like.
I did end up using transaction groups, but since SQLite does not like dates, i created a string expression tag storing ‘dateFormat(now(()-86400000), “MM/dd/YY”)’ and used that instead of transaction group timestamp.
Could not figure out the stacked bar in a single chart, a bit over my head at the moment, so did 2 seperate bar charts in report. Used a drop down selector bound to parameter for selecting different table to report, and a script in data source to change the table and rows in the queries. Not pretty, but it works.
Some of the reports are for hourly data over the week, and would like to have legend showing the hour, like ‘4:00AM’, but since legend is populated from column name, and SQL does not like numbers in column name and definitely no colons, having some trouble with that. Any ideas how to customize the legend?
For customizing the legend with your current setup, I'd change the underlying data set after the query. This would likely be done via a simple Script data source that transforms the column names based on your needs, so scripting would be required: Scripting Data Source | Ignition User Manual
There are some pretty simple examples here, the report is expecting a dataset and you can interact with it and provide an altered dataset that your design expects instead.
It looks like all of your columns are ending up with the same name. If I remember correctly, column names can not start with a number. I think it is changing the column names to AM_ instead.
Is there a way to make legend use a different list than header, so column names don't start with a number, but user gets to see a number as the identifier?