Ewon TechForum
Providing technical solutions to technical requests


Central Data Collection
Edward Ross Offline
Junior Member
#1
We are building a fetcher tool to read data from the M2Web API and log it centrally in a database. We are planning to use the following database structure.

The database will contain a table to store a list of tags to collect and a table containing the historical
tag values.

The tag names will have the following fields:
• Tag ID
• eWon Talk2M ID
• ModBus Tag Address
• Tag Name
• Tag Description

Tag historical tags table will have the following fields:
• Tag ID
• Timestamp

Are there any tips about the database structure from those who have done this before?
Reply

simon Offline
eWON Support
#2
(22-08-2016, 03:54 PM)Edward Ross Wrote: We are building a fetcher tool to read data from the M2Web API and log it centrally in a database. We are planning to use the following database structure.

The database will contain a table to store a list of tags to collect and a table containing the historical
tag values.

The tag names will have the following fields:
• Tag ID
• eWon Talk2M ID
• ModBus Tag Address
• Tag Name
• Tag Description

Tag historical tags table will have the following fields:
• Tag ID
• Timestamp

Are there any tips about the database structure from those who have done this before?


Edward,

Good to hear :-)

1. Why to put the Talk2M ID in the Tag database as it is common to the whole application ?
2. Historical tags, I guess you miss the value and the quality fields ?
3. Why don't you use the Datamailbox for getting this historical data ? (https://developer.ewon.biz/content/dmweb-api).  The only thing the Datamailbox won't provide is the Modbus address of the Tag but you could easily get it from a M2Web API call.

You could get ideas from eSync (= our tool to gather data) regarding the database structure : https://ewon.biz/sites/default/files/aug...gement.pdf

Regards
Reply

Edward Ross Offline
Junior Member
#3
Thanks for your reply. The esync table structure is a useful reference here!

1. Why to put the Talk2M ID in the Tag database as it is common to the whole application ?
There will be multiple eWON routers - so by this variable I mean to identify the router.  This would be equivalent to the entries in the table esync_stations


2. Historical tags, I guess you miss the value and the quality fields ?
Oops - yes, I meant to include a value field here!

3. Why don't you use the Datamailbox for getting this historical data ? (https://developer.ewon.biz/content/dmweb-api).  The only thing the Datamailbox won't provide is the Modbus address of the Tag but you could easily get it from a M2Web API call.
Yes, this is probable the best API for me to use. Thanks for drawing my attention to this.
Reply

Edward Ross Offline
Junior Member
#4
I have two follow up questions, which weren't clear to me after looking in the eSync manual:
- Does the eSync tool also use the Data Mailbox through the dmweb-api?
- Does the eSync tool automatically fetch data at certain intervals, or does it need to be manually triggered

I found this presentation, which answers my question on pages 15 and 16, eSync needs to be on a public IP and is used instead of the data mailbox.
https://developer.ewon.biz/sites/default...Vision.pdf
Reply

Kevin Offline
Junior Member
#5
(25-08-2016, 05:52 PM)Edward Ross Wrote: 1. Why to put the Talk2M ID in the Tag database as it is common to the whole application ?
There will be multiple eWON routers - so by this variable I mean to identify the router.  This would be equivalent to the entries in the table esync_stations

Are the eWON's registered to separate accounts? I'm not entirely sure if you mean eWON ID or Talk2M ID.
The getewons API call will return eWON ID's. If you haven't yet looked over the DMWeb API, I suggest looking it over to get an idea of how data will be returned to you. This will help you identify the best way to structure your database to get the data you need.

I'm not sure how much granularity you need, but in general it's good DB practice to remove as much redundancy as possible. So, you'd most likely want to store definitions for eWON's in a separate table, perhaps topic definitions separately (If you expect to receive data under multiple topics), then a historical data table. Link everything with foreign keys to make life easier on yourself in the future.

(26-08-2016, 11:23 AM)Edward Ross Wrote: - Does the eSync tool automatically fetch data at certain intervals, or does it need to be manually triggered

I can't answer your first question regarding if eSync uses the DM (I don't know what they use), but I can answer this one.
You can specify conditions to upload data or time intervals to upload data. Data should be available for collection once the eWON's have pushed it to the server.

eWON refers to this as "Push technology", you can read some more about this here:
https://developer.ewon.biz/content/esync
Reply

simon Offline
eWON Support
#6
- Does the eSync tool also use the Data Mailbox through the dmweb-api?
There is an add-on for enabling the Data collection through the Data mail Box in eSync : https://ewon.biz/sites/default/files/kb-...nector.pdf
- Does the eSync tool automatically fetch data at certain intervals, or does it need to be manually triggered
No, eSync is a web server that waits for the eWON HTTP(S) Posts.  So, when using eSync, this is the eWON that pushes its data and not the eSync that polls the eWON's data.
When using the DataMailBox connector for eSync, we add some PHP scripts in eSync that grab the data from the datamailbox. This script is triggered automatically thanks to a Windows Schedule task.
Reply

simon Offline
eWON Support
#7
Thanks Kevin!!
Good job Smile
Reply



Possibly Related Threads…
14-10-2019, 05:37 PM
Last Post: simon
06-11-2018, 07:00 PM
Last Post: simon
  Esync Historical Data Store Started by Chiacomo
1 Replies - 2.444 Views
01-02-2018, 02:37 PM
Last Post: simon



Users browsing this thread:
1 Guest(s)



Theme © Ewon 2019 - Forum software by © MyBB - Cookie policy