<< Click to Display Table of Contents >> Navigation: Live > Agents > File Agents > Campbell Scientific LoggerNet > Live Campbell Scientific LoggerNet Agent Installation and Configuration |
Scheduled data collection must be configured within LoggerNet for the desired data logger(s). Data from the data logger(s) is downloaded by LoggerNet and written to local files on a specified schedule. The Setup Screen (within LoggerNet) shows each data logger that LoggerNet is connected to. The Schedule tab allows you to enable scheduled data collection for the selected logger and define the Collection Interval. The following image illustrates an example data logger that is scheduled for data collection every fifteen (15) seconds:
The Data Files tab allows you to choose the desired table(s) and an output file name. Be sure to set the File Output Option to Append to End of File and the Output Format option to ASCII Table Data, Long header (TOA5) as shown here:
Follow these steps to install, configure, and start the EQuIS Live LoggerNet Agent.
The EQuIS Live LoggerNet Agent needs to be installed either on the same machine as LoggerNet, or somewhere with full access to the LoggerNet output files (*.dat).
Before starting the service, make sure that its Log On As account has read and write access to the watched files and folders, and add the desired data logger(s), as explained in the next section.
After installation and licensing, you are ready to start adding data loggers. Data loggers can be added into EQuIS Live via the command prompt or a folder watcher.
1.Ensure the following App Settings in the *.config file:
2.Set folderWatcherPath to a path on the local computer (e.g., C:\Campbellsci\LoggerNet).
3.Set folderWatcherFilter to *.dat or empty.
4.Set folderWatcherAddsFileWatchers to true or empty.
5.Run the EQuIS Live LoggerNet Agent as a service (see the Continuous Data Loading section below), or as a console app (with no command line options).
6.In LoggerNet, Data Files tab, set the Output (path and) File Name so that LoggerNet will create the *.dat file in folderWatcherPath. (Or manually copy a Campbell Scientific LoggerNet Output file (*.dat file) to folderWatcherPath.)
Note: The folder watcher will also load new data that is appended to the file, so long as the EQuIS Live LoggerNet Agent remains running. |
---|
You can open the DT_LOGGER table and review/change the logger info for a *.dat file. If you do not have a LOGGER_ID, you can use the LIVE_DATA_SOURCE to locate the logger; it contains the path and file name for the LoggerNet *.dat file.
1.Set UTC_OFFSET_HRS appropriately (based on the offset of the date/time setting used by the data logger).
2.Set FACILITY_ID and SYS_LOC_CODE to associate this logger with a location.
3.Set LOG_PERIOD_S (seconds) to represent how often the data logger logs data.
4.Set TRANSMIT_PERIOD_S (seconds) to represent how often the data logger transmits data to LoggerNet.
5.Set CUSTOM_FIELD_4 to enable automatic file archiving when the file reaches the specified length.
The Campbell Scientific LoggerNet *.dat files may contain existing data (from previous data collections). You can load any *.dat file (e.g., historical archived files) into a given logger even if the filenames differ. Existing data can be loaded into EQuIS Live using the "loaddata" commands.
When the application starts, it connects to the EQuIS Live database and searches the DT_LOGGER.LIVE_DATA_SOURCE field for *.dat files located on the local machine. The DT_LOGGER.LIVE_DATA_SOURCE field is populated by adding a logger, by following the steps in the Add Logger(s) section above.
For each applicable *.dat file, the agent establishes a file watcher to watch for changes to the *.dat file. Whenever the *.dat file changes (i.e., when LoggerNet performs a scheduled data collection), the agent will scan the file for new records and load the new data into the database. For each *.dat file, the agent maintains a bookmark (saved position within the file) to optimize loading of new data. If errors occur while loading data, the records that caused the errors will be written to a *.dat.errors file (with the same path and file name as the *.dat file).
To create another instance of the LoggerNet Agent on the same machine or server:
1.Make a copy of the LoggerNet Agent folder and rename that folder. Now there should be 2 (or more) LoggerNet Agent folders with separate names.
2.Update the connection string in the newly copied EarthSoft.Live.Agents.LoggerNet.exe.config file to reflect any database or credential changes.
3.Set the "serviceNameSuffix" in the EarthSoft.Live.Agents.LoggerNet.exe.config file (e.g., "2") and install another version of the LoggerNet Agent Windows Service. These steps can be found here.
4.Set the "fileWatcherFilter" and/or "folderWatcherFilter" in the EarthSoft.Live.Agents.LoggerNet.exe.config file to watch different files and/or folders, if desired.
5.If using the RollingLogFileAppender in the log4net.config files, change the PatternStrings so that each LoggerNet Agent instance is logging to a different file, since multiple LoggerNet Agent instances cannot write to the same file at the same time.
6.If more than one LoggerNet Agent instance is watching the same file (e.g., to add its data to more than one database), then set the "addErrorLinesToFile" in the EarthSoft.Live.Agents.LoggerNet.exe.config file to false for all, or all but one, of the LoggerNet Agent instances. Alternatively, the "fileAndFolderWatcherDelay" can be set to delay the processing of one or more of the LoggerNet Agent instances, since multiple LoggerNet Agent instances cannot write to the same file at the same time.
To move a *.dat file from one folder to another folder:
1.Stop the LoggerNet Agent.
2.Change the folder in the *.dat file's DT_LOGGER.LIVE_DATA_SOURCE, e.g., using EQuIS Professional.
Tip: To move multiple *.dat files, it's easier to use SQL, e.g.,:
DECLARE @before VARCHAR(500) = 'csi://COMPUTER_NAME/C:/EarthSoft/Live/TOA5/'; DECLARE @after VARCHAR(500) = 'csi://COMPUTER_NAME/C:/Campbellsci/LoggerNet/';
-- View dt_logger rows BEFORE they are updated. SELECT * FROM dt_logger WHERE live_data_source LIKE '%' + @before + '%';
UPDATE dt_logger SET live_data_source = REPLACE(live_data_source, @before, @after) WHERE live_data_source LIKE '%' + @before + '%';
-- View dt_logger rows AFTER they are updated. SELECT * FROM dt_logger WHERE live_data_source LIKE '%' + @after + '%';
|
---|
1.Update the folderWatcherPath app setting, in the *.config file, if it's populated with the old folder path.
2.Start the LoggerNet Agent.
Copyright © 2023 EarthSoft, Inc • Modified: 26 Apr 2022