Author Topic: Trending Chart  (Read 13478 times)

Gene T.

  • Newbie
  • *
  • Posts: 42
    • View Profile
Re: Trending Chart
« Reply #15 on: March 02, 2019, 06:44:23 PM »
OK I will check and see if I can make it work.
Thanks!!

Gene

Gene T.

  • Newbie
  • *
  • Posts: 42
    • View Profile
Re: Trending Chart
« Reply #16 on: March 02, 2019, 09:40:31 PM »
I wasn't able to replicate exactly, but some issues were fixed that was possibly related. These are in the Beta27 release
I am still having the same issue. First chart works on form1 and chart on Form2 does not. Since you can't replicate the problem it must be something that I am not doing correctly but I surely can't put my finger on it at the moment. I tried with the driver on each form pointed to the same plc and tried pointing each at a different plc.

Godra

  • Hero Member
  • *****
  • Posts: 1447
    • View Profile
Re: Trending Chart
« Reply #17 on: March 02, 2019, 10:50:54 PM »
I just tried this with ChartWithLogging on each, the MainForm with the FormChangeButton and the Page2 form as it is, each with its own ModbusTCP driver pointing to MODRSsim2 simulator (2 simulators all together, setup with different ports).

Both charts were working and logging to separate directories.

Gene T.

  • Newbie
  • *
  • Posts: 42
    • View Profile
Re: Trending Chart
« Reply #18 on: March 02, 2019, 11:43:07 PM »
I just tried this with ChartWithLogging on each, the MainForm with the FormChangeButton and the Page2 form as it is, each with its own ModbusTCP driver pointing to MODRSsim2 simulator (2 simulators all together, setup with different ports).

Both charts were working and logging to separate directories.
I started from a clean slate and added charts to mainform and page 2 just as you stated and it works just as you stated. I started from a clean slate again and created two forms with a chart on each. The first trend worked the first time I went to form1. The second chart on form2 did finally work but I had to return to mainform and back to form2 three times with trending data showing on the third attempt. I know that sounds strange but at least it is working for me know. Thanks for the help.

Gene

Godra

  • Hero Member
  • *****
  • Posts: 1447
    • View Profile
Re: Trending Chart
« Reply #19 on: March 02, 2019, 11:49:45 PM »
Since you are creating new forms then look at the code from Page2 and make sure that necessary sections are copied to your new forms as well.

Gene T.

  • Newbie
  • *
  • Posts: 42
    • View Profile
Re: Trending Chart
« Reply #20 on: March 03, 2019, 02:07:12 PM »
OK my problem returned when I tried to implement into my application instead of just the simple pages I was using.
What I have found is that if I use the same tag each with a different comcomponent the chart will not work. SO if I read System_Pressure from EthernetIPforCLXCom1 everything is fine. If I add System_Pressure from EthernetIPforCLXCom2 to the same chart it will not work.

Gene

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
Re: Trending Chart
« Reply #21 on: March 03, 2019, 02:50:38 PM »
What I have found is that if I use the same tag each with a different comcomponent the chart will not work. SO if I read System_Pressure from EthernetIPforCLXCom1 everything is fine. If I add System_Pressure from EthernetIPforCLXCom2 to the same chart it will not work.
- In Solution Explorer, expand down the AdvancedHMIControls Project
- Expand down the Controls folder
- Expand down the Charting folder
- Right click ChartWithLogging.vb and select View Code
- Go to line 362 and change to this:
Code: [Select]
If String.Compare(e.PlcAddress, m_PLCAddressValueItems(index).PLCAddress, True) = 0 And (sender Is m_PLCAddressValueItems(index).ComComponent) Then

Gene T.

  • Newbie
  • *
  • Posts: 42
    • View Profile
Re: Trending Chart
« Reply #22 on: March 03, 2019, 05:00:27 PM »
That took care of the problem, however, I discovered that if one of the plc's has no communication that will also keep the chart from working. so maybe I must rethink the way I group the charts. I have anywhere from 2 to 8 machines in a system. I usually trend all of the alike variables on the same chart, so maybe I need to just trend all variables from one machine on a single chart since it is not uncommon to power down a machine for maintenance purposes. Thanks for your help.

Gene

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
Re: Trending Chart
« Reply #23 on: March 03, 2019, 05:31:21 PM »
That took care of the problem, however, I discovered that if one of the plc's has no communication that will also keep the chart from working.
On startup this would be true, but once the chart has started if a PLC goes down it will not stop the chart. I will look into a way to make this work even if the PLC is down.

Gene T.

  • Newbie
  • *
  • Posts: 42
    • View Profile
Re: Trending Chart
« Reply #24 on: March 03, 2019, 07:36:29 PM »
Thanks Archie!

DavidSr

  • Full Member
  • ***
  • Posts: 170
    • View Profile
DATA LOG FILE CREATION
« Reply #25 on: March 05, 2019, 11:26:25 AM »
I am still running B26 so maybe this is resolved.
I am not seeing the log file getting created again after creating new charts.  When is it supposed to create the file(s) ?
David

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
Re: DATA LOG FILE CREATION
« Reply #26 on: March 05, 2019, 12:49:35 PM »
I am still running B26 so maybe this is resolved.
I am not seeing the log file getting created again after creating new charts.  When is it supposed to create the file(s) ?
The first file is created at a change of day (midnight) or when the app is closed. It was necessary to cache the data in order to make the chart very responsive. If the app is not properly closed, such as using the stop button in VS, then the file will not be written. This will probably eventually be changed to write the cache on some interval.

DavidSr

  • Full Member
  • ***
  • Posts: 170
    • View Profile
Re: Trending Chart
« Reply #27 on: March 05, 2019, 12:54:45 PM »
...................This will probably eventually be changed to write the cache on some interval.
That would seem to be a good solution and would provide some sort of crash protection.
Any consideration for users choice in log file name? or at least part of it?  Or is it already there and I don't see it?
« Last Edit: March 05, 2019, 12:56:29 PM by DavidSr »
David

Phrog30

  • Guest
Re: Trending Chart
« Reply #28 on: March 05, 2019, 02:21:20 PM »
Archie, have you considered using SQLite?  I created some trends a few years ago and they were pumping data, it was very responsive.  Now, I was using MySQL back then, but I would expect SQLite to be the same.  I like SQLite because it's very easy to integrate into a project.  Just my two pennies.

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
Re: Trending Chart
« Reply #29 on: March 05, 2019, 05:48:02 PM »
Archie, have you considered using SQLite?
I looked at a number of packages that supported using SQL for data retrieval because it would have made life much easier, but none of them fit the bill. I had to rule out SQLLite because it is based on native code. Whenever a .NET application steps out of managed code, it risks future compatibility with other frameworks, such as the .NET core, and can also create cross platform issues. The goal is to keep AdvancedHMI 100% managed code for future possibilities of moving to .NET Core and/or .NET Standard.