![]()
|
Importing data files
You can use the ExcelCsvFileImport component
or the Delimited File Import component
to import data to create a NiagaraAX history based upon data in any (local) comma-separated-values (CSV) text file created by Microsoft Excel. These history file import descriptors reside under the HistoryNetworkExt (Histories extension) of a FileDevice in a FileNetwork. You use the DelimitedFileImportManager view of the Histories extension to add history file import descriptors.
Note: This import ExcelCsvFileImport descriptor is similar to the DelimitedFileImport descriptor, but assumes CSV data specifically created by Microsoft Excel (it lacks the “Delimiter” property). This allows complex CSV-delimited data to be successfully imported, using the special rules of Excel CSV generated files. For any other type of delimited data (for example, tab-delimited or “pipe-delimited”), use the DelimitedFileImport descriptor instead of the Excel CSV descriptor.
This import descriptor has properties “common” among all history import descriptors, such as Name, History Id, and so on. See “Properties of history file import descriptors” in the NiagaraAX User Guide for other configuration properties.
Import a data delimited file
Note: Files that you want to import must be on the local server. You cannot remotely import excel CSV files.
Histories can be imported from Microsoft® Excel® files or non-Excel produced files using the FileDevice driver. These files can be placed on the a NiagaraAX workstation server and imported from the location where they reside. The import driver requires that the timestamps are consistent and clean or an import fault will occur which may cause the file not to append to an existing history.
- Place the CSV files on the server in an appropriate folder under your station, as shown in Figure 5-3.
Figure 5-3 Importing an Excel CSV file![]()
- In the NiagaraAX Workbench nav tree, under your station database (Config node), click on the Drivers node to display the network devices (if any).
- In NiagaraAX Workbench, open the palette side bar.
- In the palette side bar, open the driver palette and copy and paste the FileNetwork component under the Drivers node in the nav tree, as shown in Figure 5-4.
Figure 5-4 Adding the FileNetwork driver to the drivers node![]()
Note: The FileNetwork driver includes a Local File Device. Often, a FileNetwork contains only a single FileDevice. Unlike in true “field bus” networks, the standard NiagaraAX driver architecture (network: device: device extensions) the File Device provides no “real hardware” equivalency, this is simply a modeling “convention.”
- In the NiagaraAX nav tree, under the FileNetwork node expand the FileDevice node and double-click on the File History device extension
.
Figure 5-5 Delimited File Import Manager view![]()
- In the Delimited File Import Manager view, click the New button.
- In the New dialog box, from the Type to Add drop-down list, choose the type of file that you are importing. and click the Ok button.
- The New File Import dialog box displays with fields of data that need to be reviewed and edited as necessary. The following fields are of particular importance:
- Name
The text in this field displays as the name of the import descriptor in the nav tree as well as in the descriptor’s property sheet.
- History ID
The text in this field defines the name and location of the history file that you create when importing the file.
- Value Facets
Use this field to set the value facets (units) before importing the data. This defines the units that
shortBrandName will use to analyze the data.- File
This field allows you to browse to the location of the file that you want to import.
- Time Zone
- Timestamp and Value Column index
Set these fields to correspond to the appropriate fields in the file that you are importing. Column A and Row 1 in a CSV file are both considered zero.
- Timestamp
Choose the format to match your data. Refer to the following website for an explanation of the timestamp format symbols:
http://java.sun.com/j2se/1.4.2/docs/api/java/text/SimpleDateFormat.html- In the New File Import dialog box, click the Ok button.
- In the Delimited File Import Manager view, right-click the new descriptor and select Execute from the menu to complete the import.
Note: An imported history with the exact same name can be appended to a real time log in Niagara.
|
|
|
|