TrendWindow in Factory Studio

Dear Experts.
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

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

Hi Manh,

We received your question and we are working on it.

Bests,
Tatsoft Team.

Hi Manh,

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:
image

Execute a SelectCommand to search the data in the Database:

And the result will be like this:

Does it help you?

Bests,
Tatsoft Team.

Dear Expert
Thank for your quick support.

  1. 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.
    Best.

Hi Manh,

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[0].Visible = false;

A project is attached:

Bests,
Tatsoft Team.

Dear expert
Thanks for your support.
It’s extremely to me.
Best

1 Like

Dear Expert
How can I get value each cell in Trend wwindow?
Best

Hi Manh,

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:

image_2023_03_07T14_56_49_157Z

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.

Bests,
Tatsoft Team.

Dear Expert
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

Hi Manh,

Sorry, we still didn’t understand what exactly is your question? We have information about AlarmWindow in the another Forum you asked us:

Does it help you? If not, please send us print screen from the table you want to get data from.

Bests,
Tatsoft Team.

Dear Expert
Many Thanks your support.
I results my problem.
Best

1 Like