Creating and logging Analog Agent
Firstly create Analog Agent and set logging
In logging settings choose logging mode and set data configuration.
In this example data is logging to:
C:\ProgramData\Adroit Technologies\Adroit\Configurations\TEST\Datalogs\Analog
Where “Analog” is name of .lgd file with data.
If after process data into file must be cleared, select option “Clear at start”.
After start logging You should have files into folder as below:
But folder “CSV” is created manually.
Creating BATCH file
Before creating batch file paste small console application “extract.exe” into folder with logging data:
C:\ProgramData\Adroit Technologies\Adroit\Configurations\TEST\Datalogs\
For more details about this application look into Adroit Help in Open Configurator
Next step is create BATCH file which extract logged data into .LGD to new CSV file with timestamp when file was created.
Open notepad and write:
extract localhost.Adroit,LOG$ANALOG_TO_LOG$value,,,0,CSV\LOG_%date%_%time:~0,2%%time:~3,2%%time:~6,2%.csv
Save as ExtractToCSV.bat into the same folder.
Where ANALOG_TO_LOG is name of Agent with logging data. As You see in Open Configurator in DataLog Agents:
In this moment You can try Your batch file. Just double-click on him. You should get CSV file with data in “CSV” folder
It was created manually. Next step is create script which will do the same automatically.
Creating and setting Agent Script to start batch file
Write name of Agent Script and Add Agent
Choose language as VBScript and create module into the same folder
IMPORTANT: Uncheck “Exclude path from file name”!
Write script text
SUB main()
dim shell
set shell=createobject("wscript.shell")
shell.CurrentDirectory="C:\ProgramData\Adroit Technologies\Adroit\Configurations\TEST\Datalogs"
shell.run "ExtractToCSV.bat"
set shell=nothing
END SUB
Select a subroutine as main
And choose when script should be started (create CSV)