File Processor Agent Example – CNL

<< Click to Display Table of Contents >>

Live > Agents > File Agents > File Processor > Examples >

File Processor Agent Example – CNL

This example uses one instance of the agent to process both 004 and 014 files.

 

1.Add CNL to the *.config file's processors setting, and ensure the following CNL settings:

 

Setting

Type

Description

CNL.004SeriesNames

String

DT_LOGGER_SERIES.SERIES_NAMEs for CNL 004 files

(e.g., Xe-133, Xe-135, Xe-135m).

 

If this setting is empty, use the column header text in the file, on line 3
(e.g. V1, V2, and V3).

CNL.014SeriesNames

String

The DT_LOGGER_SERIES.SERIES_NAMEs for CNL 014 files
(e.g., I-131, I-135, KR-87, AR-41, MIXNOB, BETA_PARTICULATES).

 

If this setting is empty, use V1, V2, V3, etc.

 

And default (non-CNL) settings:

 

Setting

Value

Description

addNullIfDatumValueIs

NaN|NULL


bookmark

true


dateTimeFormats


CNL 004 uses this setting to parse the date and time in the file's first line.

encoding



folderWatcherBufferSize



folderWatcherDelay

500


folderWatcherFilter



loggerDescPrefix



logDatumValueParseErrors

false


logDuplicateDatumRowErrors

true


updateExistingValues

false


utcOffsetHrs

-5

DT_LOGGER.UTC_OFFSET_HRS

 

Note: CNL does not use any other settings, including folderWatcherPath. To add the loggers automatically, the DT_LOGGER.LOGGER_CODE needs to be determined somehow (e.g., by the file type, something in the files, and/or part of the folder path and/or file name), and this has not been implemented.

 

Add Loggers

 

2.Open a command prompt.

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

4.Execute the following commands:
 
EarthSoft.Live.Agents.FileProcessor.exe addlogger CNL "CRP-AEF-RA-004" "C:\some folder"
 
EarthSoft.Live.Agents.FileProcessor.exe addlogger CNL "CRP-AEF-RA-014" "C:\some other folder"
 
And type in Y (yes), and Enter, when prompted, to add the following DT_LOGGER rows to the database:

 

LOGGER_CODE

LIVE_DATA_SOURCE

UTC_OFFSET_HRS

CRP-AEF-RA-004

cnl://COMPUTER_NAME/C:/some folder

-5 (= utcOffsetHrs)

CRP-AEF-RA-014

cnl://COMPUTER_NAME/C:/some other folder

-5

 

Note: You do not have to add TWO loggers. You can add only ONE and watch only one folder, and add all of the series and datum (in the files) to it. Or you can create more than two loggers. However, each logger must watch a different folder.

 

5.Start/restart the agent, to detect the database changes, and watch folders 'C:\some folder' and 'C:\some other folder'.

 

004 File

 

6.Copy the following 004 file to 'C:\some folder'.

 

 

Tuesday, September 05, 2017, 08:00

This line is not used.

Seconds        V1        V2        V3

28802.0000        1.234        0.12        0.051

28832.0000        2.34        0.36        0.049

28862.0000        3.4        0.136        0.047

 

 

The fields are separated by tabs.

Line 1: The data in the file starts on 2017-09-05 00:00:00 (08:00 is not used).

Line 3: Seconds is the number of seconds since 2017-09-05 00:00:00, and V1, V2, and V3 are the value names. (A file can have any number of values, but the first column must be Seconds.)

The DT_LOGGER_SERIES.SERIES_NAMEs are set to V1, V2, and V3, if they are not overridden by the CNL.004SeriesNames setting.

The values start on line 4, e.g. date = 2017-09-05, Seconds = 28802.0000 = 08:00:02 (8 hours, 0 minutes, 2 seconds), V1 = 1.234, V2 = 0.12, and V3 = 0.051.

2017-09-05 00:00:00 wraps to the next day (e.g., 2017-09-06 00:00:00) if the Seconds on a line is less than the Seconds on the previous line.

 

The agent adds the following DT_LOGGER_SERIES and DT_LOGGER_DATUM rows to the database for the data in the file's fourth line:

 

SERIES_NAME

DATUM_UTC_DT

DATUM_VALUE

Xe-133

2017-09-05 13:00:02

1.234

Xe-135

2017-09-05 13:00:02

0.12

Xe-135m

2017-09-05 13:00:02

0.051

 

014 File

 

7.Copy the following 014 file to 'C:/some other folder'.

 

 

2017 152 06 01 00.064  1.234  8.10  2.08  0  9.82e+02 -1.51

2017 152 06 01 00.124  5.678  2.75  0  0  1.14e+03 -1.41

2017 152 06 01 00.187  9.1011 -1.11  6.47  0  9.93e+02 -5.45

 

 

The fields are separated by spaces.

The file has no header line; each line is formatted like: YYYY DoY MM DD HH.HHH V1 V2 V3 V4 V5 V6, where:

a.YYYY is the year.

b.DoY is the day of year (can be any value, it is not used).

c.MM is the month.

d.DD is the day.

e.HH.HHH is the hour, formatted as a decimal number (e.g., 00.064 = 00:03:50 (0 hours, 3 minutes, 50 seconds)).

f.V1, V2, V3, V4, V5, and V6 are the values. (A file can have any number of values.)

The DT_LOGGER_SERIES.SERIES_NAMEs are set to V1, V2, V3, V4, V5, and V6, if they are not overridden by the CNL.014SeriesNames setting.

 

The agent adds the following DT_LOGGER_SERIES and DT_LOGGER_DATUM rows to the database for the data in the file's first line:

 

SERIES_NAME

DATUM_UTC_DT

DATUM_VALUE

I-131

2017-06-01 05:03:50

1.234

I-135

2017-06-01 05:03:50

8.1

KR-87

2017-06-01 05:03:50

2.08

AR-41

2017-06-01 05:03:50

0

MIXNOB

2017-06-01 05:03:50

982

BETA_PARTICULATES

2017-06-01 05:03:50

-1.51