Author Topic: Help with Data Logging  (Read 1463 times)

ex7r4n1ck

  • Newbie
  • *
  • Posts: 1
    • View Profile
Help with Data Logging
« on: December 16, 2019, 09:11:08 AM »
Long time AdvancedHMI fan, first time user. I've lurked around trying to find an excuse to use it, and when I moved companies, I now have the opportunity to try it out on a motor test stand automation project. Also new to vb.net and C#; I am using Visual Studio 2019. That being said, have mercy please. I am very familiar with a wide variety of communication protocols, industrial automation in general, and some Java, HTML, PHP, etc. I have used Omron, AB, ABB, Yaskawa, and many more PLCs, VFDs, and HMIs.

I am running a program with multiple Modbus TCP drivers, an Allen-Bradley driver for a Micrologix, and an ethernet/IP driver. All the communications work. I am displaying the data in a variety of ways and have some user controls. All that works well.

I have used both the latest public release and the beta 34.

My primary problems are around the datalogging. I have used both the BasicDataLogger and BasicDataLogger2. I've also used the ChartWithLogging.

There are three issues, though I think Godra posted a solution to one.

1.) How could I have the BasicDataLogger2 create a new file with a custom name at certain times? For example, a user starts a test, and new a file would be created with the datetime in the name(or serial#, etc.).

2.) How can I add the column headers to the datalog when a new file is created? I believe Godra posted the solution here: https://www.advancedhmi.com/forum/index.php?topic=2519.0 - I have not yet had a chance to test it out. Thank you in advance for that.

3.) How could get the BasicDataLogger2 to record data from 2 or more communication drivers at once? Similar to how the ChartWithLogging works.

I have tried modifying the code for the BasicDataLogger2. I copied the BasicDataLogger2 and the DataSubscriber2, renamed them BasicDataLogger3 and DataSubscriber3. I changed the pointers to the new files. I then copied the data selection code in the Subscriber area and the PLC selection code. I modified it to simply have a 2 or 3 at the end of each object name. The closest I've got is down to about 110 errors.

Thank you in advance for the help.

Edit: Also neat that this is this forum's 10,000th post.
« Last Edit: December 16, 2019, 10:27:46 AM by ex7r4n1ck »

Godra

  • Hero Member
  • *****
  • Posts: 1446
    • View Profile
Re: Help with Data Logging
« Reply #1 on: December 16, 2019, 03:48:27 PM »
The attached modified BasicDataLogger2 component should cover your first 2 questions.

It has a new property "FileNameIncludesTime" which when set to True will create a new log file every time the application is started.

As for your 3rd question, I don't see it happening any time soon.

Phrog30

  • Guest
Re: Help with Data Logging
« Reply #2 on: December 16, 2019, 07:02:45 PM »
It's open source, so if you want a feature, write the code yourself.  You don't even need to ask here, there are a ton of sources on the web to help. 

You can use a datasubscriber to get all of the data yourself.  Then log the data however you want, either on change or time based.  It's up to you.  Take a stab at it, if you need help ask away. 

Archie will almost always give his code.  So if you want to see how he did the multiple drivers in ChartWithLogging, as for his code.  Then you can create your own control.