0

How to Configure the CSV Collector (version 25)

There are two files that need created/configured upon installing the CSV Collector:

  • SAF_ImportService.config
  • SAF_Import.config

SAF_ImportService.config

By default, the service config file is located in C:\Program Files\Canary\Collectors\CSV. Below is an example of how it is configured where

  • FileDependency – when set to True this requires the Collector to process files one at a time. It implies that there is some dependency between the files. Default value is False and should only be set to True in unique situations.
  • Interval – frequency, in number of seconds, files are processed. Default value is 10.
  • InputDirectory – directory location the service will monitor for files being placed. Multiple
    directories may be defined if there is data being imported from multiple sources with different file formats.
  • NumberOfTasks – controls the number of tasks utilized when FileDependency is set to False. Default value is 12
<Settings>
    <Interval>10</Interval>
    <NumberOfTasks>12</NumberOfTasks>
    <InputDirectory>C:\CSV Import</InputDirectory>
    <InputDirectory>C:\CSV Import2</InputDirectory>
</Settings>

SAF_Import.config

The SAF_Import.config will need to be created and must reside in every directory specified in the InputDirectory parameter from above. This config tells the service how to parse the CSV files that will be placed in the directory to be processed. As CSV files can vary with different formats, there are over 40 parameters to choose from to match the file's particular structure. (See attached Canary CSV Collector Configuration.pdf above for these parameters. This PDF is also located in the install directory, C:\Program Files\Canary\Collectors\CSV.) Once a file is dropped into the specified directory, the service will attempt to read and log the data into the Historian.

<Settings>
    <InputDelimiter>,</InputDelimiter>
    <HeaderCount>0</HeaderCount>
    <Historian>localhost</Historian>
    <DataSet>Demo</DataSet>
    <TagNameOffset>0</TagNameOffset>
    <TimestampOffset>1</TimestampOffset>
    <ValueOffset>2</ValueOffset>
    <QualityOffset>3</QualityOffset>
    <KeepProcessedFiles>True</KeepProcessedFiles>
    <ProcessedDirectory>C:\CSV Import\Processed</ProcessedDirectory>
    <AutoCreateDataSet>True</AutoCreateDataSet>
    <AllowInsertedData>True</AllowInsertedData>
</Settings>

SAF_Mapping.config (optional)

An optional SAF_Mapping.config file can be created to map tags from the csv file to a new tag name prior to be logged. This file should reside in the same directory as the SAF_Import.config file. The file should be in XML format and contain mappings in the following structure:

<root>
  <map>OriginalTag1,NewTagA</map>
  <map>OriginalTag2,NewTagB</map>
  <map>OriginalTag3,NewTagC</map>
</root>

If a tag name coming from the csv file is not found in the mapping file, the original tag name will be logged.


A restart of the CSV Collector service is required to pick up any modifications that are made to any of these files.

Reply

null