Features, discussions, tips, tricks, questions, problems and feedback

Exporting values from the Datalog agents to CSV

Often, you might want to export historical data into a human readable format like a CSV that can be opened in Excel.
This can easily be accomplished with the LGD2CSV utility that can be installed from the Adroit Additional Components.
The executable file can be copied into the folder where the LGD files are located and then simply be executed. A window will popup, and all the LGD files in the folder will be processed and a CSV file will be created per tag that was logged to that CSV file.

You can download the lgd2csv.exe file here. lgd2csv.exe (1.3 MB)

3 Likes

You can as well use datalogretrieval graphic form and export to excel function there. Graphic form can be found in Shapes Wizards and Examples.GF Examples.DataLogRetrieval project. Also, find the script behind for Your custom use.

1 Like

Hi damiand,
While reading this document I’m confusing datalog file extensions, also appeared some questions. Please correct me if I understand wrong.

1-
.LGD is a datalog file extension.
Then what is .LDG file ?
These (.LGD and .LDG) extensions used interchangeably.
Could you please clarify? Which one is for what?

2-
I found that .LDG file is a single file for each Configuration and located in the following path:
C:\ProgramData\Adroit Technologies\Adroit\Configurations\Default\Data[ConfigurationName].LGD
All logged tags are stored in a single .LGD file but all are backedup as a separate (.LGB) file based on tags. Is it correct? Also .LGB files are created only once per month by default. Is it customizable?

3-
As henkc explained above, using LGD2CSV utility for CSV creation. By this tool we can create tag based CSV files manually running the tool. Is there an automatic .CSV log creation way?

4-
I think How_to_effectively_log_your_Adroit_data.pdf document is for Adroit 10.
I am using Adroit 8.4. Can I get CSV backups by only checking the Enable CSV backups option in Datalog Agent Edit window (screenshot is in below)

Please enlighten me,
Looking forward for your response

1 Like

Hi ebakyt,

  1. This is just misspelling. It should be always LGD.
    1. and 4. This is all correct. The Datasource from Your screenshot is the actual LGD filename where the log is stored so You can change it to be anywhere else. So You can have multiple datalogs in one file or seperate.One thing to remember is that sum of all datalogs in one file cannot be bigger than 2 GB, otherwise You need to split it into more files. This can be also changed using Excel Add-in.
      The backup period is setup below in the “Backup period”, You choose between daily/monthly etc. The enable CSV backups will enabled option will also create in the same place CSV backups the same way as LGB so automatically.
      For more info on these functionalities You can always just click “Help” button, it is always accurate to the version which You are using.
2 Likes

Dear damiand, thank you a lot for quick reply.

A few more questions, please clarify:

  • We can ONLY split the LGD files usin Excel Add-In. Is there other options to do it?
  • In the above screenshot what is the purpose of Length Option? I’ve read the Help for Log Length but didn’t understand. Could you please explain it a little?
  • As I asked above for automatic .CSV log creation we can check the Enable CSV backups option and change the Backup Period to the shortest time (e.g. Daily). Am I right?
1 Like

Hi there,

  • Just click here:
    obraz
  • It’s the amount of data that is held in LGD file (minimum amount - if You are using continuous method then if changes are less often than the deadband it can be longer).
  • Yes.
2 Likes

Thank you very much damiand.
I appreciate it.

Dear damiand,

I’ve configured Log options as shown in below image.
I’ve selected separate file (TestVal.LGD) for TEST_ANALOG_VAL agent.
Set the backup period to Hourly option. Waiting for about 2 days.
TestVal.LGD is getting logs but still it didn’t backup neither .LGB nor .CSV file.

What am I doing wrong? !
My aim is to get auto .CSV logs.
Please guide me, how can I achieve my aim ?

Hi ebakyt,
This comes from MAPS help:

It is IMPORTANT to understand that this Backup period setting does NOT force the datalog (.LGD) file to be backed up at the specified interval (which would place too high an overhead on the data logging sub-system) instead this setting only determines how many individual backup files are created to store the historical data, when the datalog (.LGD) file is filled (wraps).

Note: this “Backup period” setting is ALWAYS set to Monthly (so each file contains a month of data) and cannot be disabled.

In other words, backups start to being created only AFTER the 10-days LGD file will be filled up to maximum. If You require something based on specific interval then You would must either create a .bat file with instructions to run lgd2csv periodically (You can add bat files to windows scheduler mechanism) or script it internally.

1 Like

Thank you very much damiand, I got it.

What does it mean that some options are global to all sets?

You can see in Data Set Configuration on screenshots there is a “Set number”.
One Agent can have multiple datalog sets - > multiple configurations of different logs.
From Help of datalogging, what “Set” mean:
These settings apply to all Data Sets configured upon one Agent.