TagHistorian trigger

Dear Expert
In my project, I create some HistorianTable. Please see below picture


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.

Hi Manh,

We received your question and we are working on it.

Bests,
Tatsoft Team.

Hi Manh,

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.

The image below illustrates the explained:

If this way you use more tags than you want, please give us more information of how you would like it to be.

Hope it helps you.

Bests,
Tatsoft Team.

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

Hi Manh,

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:

  1. 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?
  2. Are you going to use the same trigger for all tables? For example, when you save one table, you will save all 100 tables?
  3. 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?

Bests,
Tatsoft Team.

Dear Expert
Thanks for your feed back
Please allow me to explain as follows

  1. Tag is TagName in Historian window
  2. Each table have some differ column. The period trigger is the same but the quality trigger is different
  3. I want to trigger when quality of any tag belog to table change.
    Best

Hi Manh,

For us to find you the best solution, we need to understand better this question

  1. Why do you want to save the data when the Tag Quality change?

  2. 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?

Bests,
Tatsoft Team.

Dear Expert
Thank for your Feed back.
Let me provide the informations

  1. 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
  2. I dont need to save when value of tag change because the historical data is very big.
    Best

Hi Manh,

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.

Bests,
Tatsoft Team.