I have a power table on a screen that is showing tag values. The tag values are being populated from a tag history binding and a shared script. The explanation of how the table is being creating is at the end.
My goal is to take what I see in that power table and put it into a SQL table. Constantly updating the SQL table every minute and writing over the old data.
I am thinking of somehow writing the data from the table into a dataset tag and then writing what is in the dataset tag to the SQL database table.
I am open to other options.
But the Tag Historian already has it in SQL. You wish transfer from SQL to SQL via a Power Table? What happens when no client is open? Or two or five or ten clients?
Please share what you really need so we can provide useful advice.
I created another ticket for this but I this gives the explanation of how the table is created. It is not just moving data from table to table.
Each row is related to a different site/well. It is getting the most current historical record for 28 different tags related to 45 different wells from 8 site locations.
Basically taking certain tag values from all over the project and putting them in a SQL table, updating it with realtime values every minute or so.
Secondary/Explanation: Improving the way the table is created. This table's purpose is to show Realtime values.
This is the shared script compiling the data. Global Script:
Shared Script Systems Overview.txt (30.7 KB)
This is the binding on the data property of the power table.
Systems Overview Data Binding.txt (1.2 KB)
Here is part of the table. It has 28 columns and 45 rows. The rows will get larger in the future.
The window has the properties shown below.
The binding on each of the properties is shown below.
All this to display the most recent values of tags?
Are the tags arranged in folders with identical inner tag names? (Or UDTs, which have the same effect?)
If so, a template that displays one row of tag values, using indirect binding, arranged in a template repeater, would be far more performant. With no SQL at all. (The template repeater would be set to dataset mode, and that dataset's one column would have the necessary tagpath strings.)
I agree it is cumbersome. It started with only 3 rows and has grown over time. I will look into making it cleaner in the future, but what I need right now is to just put all this data in SQL.
Hopefully we can forget how the table is made for now. -- Because, I have a button, that when clicked, creates an excel spreadsheet simply based on what is in the power tables cells at that time. I am hoping I can use the same mentality to just take what is currently in the Power Table and dump it into a SQL table.
Another department needs this data to be in a SQL table, in the same fashion as they see it on the screen so they can extract it for a report.
Like a runPrepUpdate funtion to take the whole table and insert it into a SQL table.
Also, there are some identical inner tag names but few to many variations so it is not templated across the board.