Hi,
I have developed a DataMailbox driver that generates CSV files.
This program is actually based on the "MyLittleHistorian" example provided with DataMailBox SDK.
For users : just copy the directory "ReadyToUse" in the attached zip.
For developers : All the source code is in the zip.
How to configure it ?
Copy the directory "ReadyToUse" in c:\
Create a file named "config.ini" and type your parameters. There is an example in the directory.
Here is the list of parameters available :
The config.ini file is deleted at the first start (except if you simply launch a getewonslist command to read Ewon Ids). The settings are then saved in a specific application file only accessible by the SYSTEM (Admin) user.
How to launch it ?
You can launch it manually by clicking the exe file.
Or
If you want to run it automatically, just right-click the file "installMyCSVHistorianScheduledTask.bat" and select "Run as Administrator".
This will add a new Scheduled Task in Windows. This task will launch the program automatically even if you are not logged and will run every 5 min (Can be configured by editing the Scheduled Task).
Troubleshoot
If you don't get your data, you have a file "Log.txt" which contains the logs of the last execution.
I have developed a DataMailbox driver that generates CSV files.
This program is actually based on the "MyLittleHistorian" example provided with DataMailBox SDK.
For users : just copy the directory "ReadyToUse" in the attached zip.
For developers : All the source code is in the zip.
How to configure it ?
Copy the directory "ReadyToUse" in c:\
Create a file named "config.ini" and type your parameters. There is an example in the directory.
Here is the list of parameters available :
- DevId:Type the DevID
- APIToken:Type the Datamailbox API token - Generated in eCatcher (>= 6.6.4) (Available as of ver 1.0.0.2)
- AccountName:Type your account (No more available in 1.0.0.2)
- Username: Type the password of your Talk2M account (No more available in 1.0.0.2)
- Password: Type the password of your Talk2M account (No more available in 1.0.0.2)
- DeleteData: Delete the data of the datamailbox after collecting it (yes/no). If multiple instances are collecting data on the same account, type "no"
- CSVFileName: Name of the CSV file generated. This field can accept some dynamic keywords : %YEAR%, %MONTH%, %DAY%, %HOUR%, %EWONNAME%, %TAGNAME%. Ex : If you use %TAGNAME% in your Filename, then a different CSV file will be created for each Tag.
- CSVTitle: Title of the each CSV file (as of ver 1.0.0.1)
- CSVLineFormat: Format of the line in the CSV. Here are the keywords available : %EWONNAME%,%TAGNAME%,%TAGDATE%,%TAGVALUE% and %QUALITY%
- DateTimeFormat:Format of the time and date according to https://msdn.microsoft.com/en-us/library....110).aspx
- CSVOutputDir: Directory where the CSV files wll be stored. The directories are automatically created. This field can accept some dynamic keywords : %YEAR%, %MONTH%, %DAY%, %HOUR%, %EWONNAME%, %TAGNAME%. Ex : If you use %EWONNAME% in your OutPutDir, then a different directory will be created for each eWON. Keep it blank if you want to save your files in the working directory.
- ForceRetrieveAll: Flag to force to program to retrieve all the data of the DataMailbox (TransactionID=0).
- EwonIds: Filter your data retrieval for some Ewons Ids only. You can set multiple Ewon Ids by separating them by a comma. You can retrieve the Ewons list including their Ids using the command "MyCSVHistorian.exe getewonslist". This command gonna use the credentials set in the config.ini file.
Code:
DevId:61XXXXX64-6ade-414e-ad4e-a79dXXXX8010
APIToken:n6x2pyv0kJLAKxXPWzDJyz8N9HAz3B5E6FmZhQEFplQaJ8G1MA
DeleteData:no
CSVOutputDir:D:\Users\sdr\mydata\%YEAR%_%MONTH%_%DAY%\%EWONNAME%\
CSVTitle:Name;TagName;Date;Value;Quality
CSVFilename:%YEAR%_%MONTH%_%DAY%_%HOUR%_%EWONNAME%_%TAGNAME%.csv
CSVLineFormat:%EWONNAME%;%TAGNAME%;%TAGDATE%;%TAGVALUE%;%QUALITY%
DateTimeFormat:MM/dd/yy H:mm:ss zzz
EwonIds:123655,555445The config.ini file is deleted at the first start (except if you simply launch a getewonslist command to read Ewon Ids). The settings are then saved in a specific application file only accessible by the SYSTEM (Admin) user.
How to launch it ?
You can launch it manually by clicking the exe file.
Or
If you want to run it automatically, just right-click the file "installMyCSVHistorianScheduledTask.bat" and select "Run as Administrator".
This will add a new Scheduled Task in Windows. This task will launch the program automatically even if you are not logged and will run every 5 min (Can be configured by editing the Scheduled Task).
Troubleshoot
If you don't get your data, you have a file "Log.txt" which contains the logs of the last execution.