I have a project that displays and alerts on data originating from an mssql database. The data is asset based and sourced from all over the world. The main screen is setup based on asset type and can handle multiple assets from multiple sites at a time, displayed via a tree view. As I select items in the treeview it filters certain screen components etc.
The alarming is setup with associated data so I can filter by site and asset and that is all good. History is handled outside Ignition, for the moment. I have a db table with timezone detail and I have sites and in turn assets configured with full knowledge of relevant timezones. The data received in the db provides for utc and site time, again I need no immediate conversion and if I do I have all timezone info available.
What I need to do is display configured alarms for all assets in a common alarms status table but display each alarm in site time, i.e. the relevant timezone.
Here is what I have looked at:
I have trolled through the forums and can find little on this. I may have had a boy look, not saying I read everything but there doesn’t seem to be much call for this mixed timezone stuff.
Yes, changing the client timezone works but on any screen I have multiple site/timezones so this is no good.
Changing timezone dynamically
You cannot write to a system tag so I cannot change the client timezone as I iterate through the treeview.
Reading data from alarmstatus table and modifying.
No go here, I couldn’t work out when or where to get it from. I am happy to do this if its an option but I don’t know what event will give me the data as it is on the screen. Note, my filterAlarm script is working well, is this the place to do it?
Adding a custom column to the alarm status table.
No go, cannot do that.
Here is what I was thinking of doing.
Creating my own alarm status table template that has two extra columns, one for site time and anther for site name.
When a user is managing multiple sites with different timezones, functionality will hide the ‘Active Time’ column and show the ‘Site Name’ and ‘Site Active Time’ columns as well as changing the sorting to take into account the site name.
Here are my questions… finally
Is this the right approach ? Is there a better way to do this?
If I use my approach can I put an alarm status table on the page, hide it and somehow get the dataset from that do I don’t have to requery the database ?
When do I get the data from either the alarm status data or the alarm table, is there an event I can use to say get it now or do I just poll the database ?
If anyone could offer some advice here it would be very appreciated.