AdvancedHMI Software
General Category => Open Discussion => Topic started by: msdavid on September 08, 2020, 10:35:57 AM
-
Hello everyone,
I am kinda of new to Advanced HMI software, I am loving this software so far. I am working on the project where I nead to select start date time and end date time and should download the data in csv within that range only.. So plesase please help me regarding this problem trying so hard on the internet for the solution baut not getting anything..
thanks in advance..
-
What data? Database, dataset, table, flat file, etc.?
-
This kind of data. When we use BasicDtataLogger2, the data start to getting stored in .log file automatically. But I want to set range of time date, etc. and download the csv or .log file which contains data within that range of date and time only..
-
Add a timer to your form, enable it, set its interval to what you want (maybe 1000 ms).
Set: BasicDataLogger21.EnableLogging = False
Double click the timer to enter its Tick event and add your code to check the current date/time, compare it to the date/time you want and then start the logging with:
BasicDataLogger21.EnableLogging = True
Then check the date/time again and stop the logging:
BasicDataLogger21.EnableLogging = False
-
Thanks Godra for your reply. Really appreciate it.
But I had question,
How do I access the backend data??
-
It sounds like you want to retrieve historical data using a date and time filter. Godra’s solution is good if you are looking for current data since the timer was started. If you want historical data then you probably need to go with storing it to a DB and then retrieving it from there.
-
Thanks MrPike for the reply.
Yeah, I want to retrieve the data within a range of date and time from the historical data which will be stored in local drive when we use BasicDataLogger. So basically what I want is when user will enter the start date time and end date time, then the data within that date time range is to be retrieved. I don't know how to do it. Any help is appreciated.
-
I recommend SQLite, a user has posted an example on this very forum...
https://www.advancedhmi.com/forum/index.php?topic=2607.msg15649#msg15649
Using a database is very common and not solely related to AdvancedHMI. There are tons of information out there. Search Google...
Some examples:
https://www.youtube.com/watch?v=t6j1T-5hqL4&ab_channel=EasyApp
https://www.codeproject.com/Articles/1210189/Using-SQLite-in-Csharp-VB-Net
https://www.youtube.com/watch?v=vzrE94oGXBs&ab_channel=iBasskung
https://www.youtube.com/watch?v=UN7nMNVw2hk&ab_channel=CodingWithAndrew
Some of the those examples may not apply, but I found those examples in about 15 seconds.
-
There is an old charting app that allows selecting date and time from the log created by the BasicDataLogger:
https://www.advancedhmi.com/forum/index.php?topic=571.0
It hasn't been updated in quite a while and if you are to use it then don't expect to get support for it.
Your time might be better spent learning how to use database.