Installation and Configuration

<< Click to Display Table of Contents >>

EQuIS 7  >>  Enterprise > EQuIS Live > Agents > Campbell Scientific LoggerNet >

Installation and Configuration

Campbell Scientific LoggerNet 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:

 

10162-loggernet_15_seconds_zoom94

 

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:

 

10162-loggernet_file_output_zoom94

 

Installation and Setup

 

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.

 

Add Logger(s)

 

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.

 

Command Prompt

 

1.Locate the Campbell Scientific LoggerNet Output file (*.dat file) for the desired logger (e.g., C:\Campbellsci\LoggerNet\datalogger_001_Public.dat).

2.Open a command prompt.

3.Change to the folder where EQuIS Live LoggerNet Agent is installed (e.g., C:\Program Files\EarthSoft\EQuIS Live\LoggerNet Agent).

4.Execute the following command to add the logger to EQuIS Live (use the correct file path to the *.dat file):
 
EarthSoft.Live.Agents.LoggerNet.exe addlogger "C:\Campbellsci\LoggerNet\datalogger_001_Public.dat"

 

5.Note the LOGGER_ID value that is assigned to the given *.dat file.

6.Note also that DT_LOGGER_DATUM will only be populated when the EarthSoft.Live.Agents.LoggerNet Service is restarted, and a change or update has been made to the *.dat file. The DT_LOGGER_DATUM can also be populated by using the loaddata command line option described below.

 

Folder Watcher

 

1.Ensure the following App Settings in the *.config file:

a.Set folderWatcherPath to a path on the local computer (e.g., C:\Campbellsci\LoggerNet).

b.Set folderWatcherFilter to *.dat or empty.

c.Set folderWatcherAddsFileWatchers to true or empty.

2.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).

3.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: This method will also load the file's data when new data is appended to the file, so long as the EQuIS Live LoggerNet Agent remains running; you do not have to restart the EQuIS Live LoggerNet Agent.

 

You can now open the DT_LOGGER table and review/change the logger info for this *.dat file (field definitions below). 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 output file (*.dat file).

 

i.Set UTC_OFFSET_HRS appropriately (based on the offset of the date/time setting used by the data logger).

ii.Set FACILITY_ID and SYS_LOC_CODE to associate this logger with a location.

iii.Set LOG_PERIOD_S (seconds) to represent how often the data logger logs data.

iv.Set TRANSMIT_PERIOD_S (seconds) to represent how often the data logger transmits data to LoggerNet.

v.Set CUSTOM_FIELD_4 to enable automatic file archiving when the file reaches the specified length.

 

Repeat steps 4-5 (command prompt) or 3 (folder watcher) above for additional *.dat files that you want to monitor.

 

Note: Any changes made to DT_LOGGER and/or DT_LOGGER_SERIES tables while the agent service is running will require a restart of the agent service.

 

Load Historical Data

 

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" command in a couple of ways:

 

loaddata all

 

1.Open a command prompt.

2.Change to the folder where EQuIS Live LoggerNet Agent is installed (e.g., C:\Program Files\EarthSoft\EQuIS Live\LoggerNet Agent).

3.Execute the following command to load data from all active *.dat files on the computer:
 
EarthSoft.Live.Agents.LoggerNet.exe loaddata all
 

loaddata [logger_id] [*.dat filename]

 

1.Open a command prompt.

2.Change to the folder where EQuIS Live LoggerNet Agent is installed (e.g., C:\Program Files\EarthSoft\EQuIS Live\LoggerNet Agent).

3.Identify the LOGGER_ID obtained from step 5 in the 'Add Logger(s)>Command Prompt' section above. The example below uses '123456' as the LOGGER_ID.

4.Execute the following command to load the data from the *.dat file into EQuIS Live (use the correct LOGGER_ID and file path):
 
EarthSoft.Live.Agents.LoggerNet.exe loaddata 123456 "C:\Campbellsci\LoggerNet\datalogger_001_Public.dat"

 

Continuous Data Loading

 

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).

 

Installing Multiple LoggerNet Agents

 

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.