February 27, 2023, 5:55pm
In my project, I have a Trend window Symbol with 2 pen ( mapped to 2 Tags arre trend_test and trend_test2) like below picture
In Runtime Mode, I could hide or unhide each pen from pen area control ( Red area 1 in picture).
But I want to do this by 2 button ( Red area 2 in picture). How can I do that? As I know that, The historial data of trend window was store in Table1 at Taghistorian dataset.
Please see below picture
Can I create other table to store historial data of trend window because I have many Trend window in my project, And I want each trend window store at seperate table.
We received your question and we are working on it.
1- Just to confirm, do you want to hide a pen using a specific button to each pen? Have you tried to use this Template, there are many examples using Trend:
2- Yes, you can create many tables like this:
Then you search the tables in Datasets > Tables:
Create a Query for each one:
Execute a SelectCommand to search the data in the Database:
And the result will be like this:
Does it help you?
March 1, 2023, 12:26pm
Thank for your quick support.
Yes. I want to hide and unhide a pen using a specific button to each pen
About Trend template. I knew it and Tried to created with this template.
This project can add pen via asset but not from button.
Please help me create button to hide and unhide pen.
For this you can create a button to run a script and use the following code:
TTrendChart trd = this.CurrentDisplay.GetControl("<TrendUID>") as TTrendChart;
trd.Pens.Visible = false;
A project is attached:
March 3, 2023, 5:20pm
Thanks for your support.
It’s extremely to me.
March 7, 2023, 11:46am
How can I get value each cell in Trend wwindow?
We understand that you mentioned the term “cell in Trend Window” but we were unsure of what you meant by it as the Trend Window object draws the pen values on a graph and does not have cells.
If you are referring to these cells on the TrendWindow configuration window, their values are the pen properties, and can be obtained through code:
If you were not talking about the TrendWindow configuration cells, could you provide more details on which cell you are referring to? It would be great if you could send us a screenshot of the element you are trying to obtain the value from. This will help us to better understand your concern and provide you with the appropriate solution.
March 8, 2023, 1:49am
Thank for your support.
I’m sorry. I had a mistake. I means that I want to value of each cell of Alarm wwindow. Not trend window
Sorry, we still didn’t understand what exactly is your question? We have information about AlarmWindow in the another Forum you asked us:
To acquire information about an AlarmWindow, the same method applied to DataGrids can be used:
For column names, number of columns and number of rows:
For the value of a specific cell:
In this case, @Tag.text will get the value of cell(0,20).
Keep in mind that the column index used in “columnSelect”, is according to the AlarmWindow Configuration page.
The ComboBox object works as a “class” in C#, its events are represented by the lightning symbol:
Does it help you? If not, please send us print screen from the table you want to get data from.
March 8, 2023, 7:04pm
Many Thanks your support.
I results my problem.