With each HistorianTable, I want to trigger acording to 2 condition are period of 1 hour or quality change event of tags in each HistorianTable. But the trigger column is only one them. I also thought make a task script for my requirement, but I have many HistorianTables and each of them have many TagName.
So this is not possible.
Are there any solution for my requirement.
Best.
To solve this problem, you can set an integer tag at trigger configuration of HistorianTable (like image below) and use an expression to change this tag value acording these two conditions.
Set the Quality property of some tag you want at trigger configuration and set one hour (01:00:00.000) at time configuration. In expression configuration you have to increment the tag setted as trigger on HistorianTable. Compile the expression and the BuilsStatus must be ok.
Dear Expert
Thanks for your Support.
In that way, I have to create expression for each table, isn’t it?
Because, I have more hundred table, so that way is not good.
Are there any better solutions?
Best
Yes, in this scenario, you will need to create a separate expression for each table. To provide you with the best solution, I have a question that will help me better understand your needs:
You mentioned that you want to trigger based on two conditions: Firstly, after a one-hour period and secondly, when there is a change in the quality of the Tag. Can you please say what specific Tag you are referring to?
Are you going to use the same trigger for all tables? For example, when you save one table, you will save all 100 tables?
Also, why do you want to save the table when the Quality changes? Do you want to trigger the Table when the tag Quality goes from 192 to 0?
For us to find you the best solution, we need to understand better this question
Why do you want to save the data when the Tag Quality change?
If in a period of 1 hour, the tag change many values you dont want to save them. You want to save only when there is a fail communication on those tags or they came back from fail, right?
Dear Expert
Thank for your Feed back.
Let me provide the informations
The Tag I get from protocol so when communication protocol is fail the quality of tag is differ 192. That is reason I need save when the quality change
I dont need to save when value of tag change because the historical data is very big.
Best
We develop an idea of code in C#, so you can use it as base to do what you described, you can use a Task to do that, it should be the more efficient way to resolve what you are looking for:
for (num of tables)
{
List GetHistorian("asdasd" + i)
For (list)
{
Get (Tag +".Quality" != Estimate)
{
Estimate = GEt (Tag +".Quality")
flagSave = 1;
}
}
if (flagSave == 1)
{
Table.ForceTrigger()
}
}
In summary, the code appears to be querying a data historian system to check if the quality of a specific tag has changed since the last time the data was updated. If there is a change, the estimate is updated and the table is forced to update its data.