CSV File Format
Specify the collector source address and the tag source address fields in the CSV file. Otherwise, the collector and source names are not added to the tags created by the File collector.
The format for a CSV file is as follows:
[<command>]
<Header keywords separated by commas>
<values separated by commas>
*Comments
Note:
Refer to the following sections for valid values and examples.- The order of the values must match the order in the header. For example, if
you are importing a tagname, timestamp, value, and quality, use the
following
syntax:
[Data] Tagname,TimeStamp,Value,DataQuality TIGER.IMPORT_TAG1.F_CV,7/20/01 11:07,1,Good
- Data values for a single entry must be placed on a single line.
- You cannot import Last Modified User, Last Modified Date, and Calculation Execution Time fields on a tag.
Valid Values for Command
- [Tags]
- [Data]
- [Messages]
- [Alarms]
Valid Values for Header Keywords
DataQuality | Value |
---|---|
Tagname | Description |
EngineeringUnits | Comment |
DataType | StringLength Note: StringLength is twice the number of characters
(ASCII, Single Byte). For example, "ABC" = 6
StringLength. |
StoreMilliseconds | CollectorName |
CollectorType | SourceAddress Note: A value is required for the source name to be
added to tags created by the collector. |
CollectorType | CollectionInterval |
CollectionOffset | CollectionDisabled |
LoadBalancing | TimeStamp Note: The timestamp resolution is
milliseconds. |
Type | TimeZoneBias |
HiEngineeringUnits | LoEngineeringUnits |
InputScaling | HiScale |
LoScale | CollectorCompression |
CollectorDeadbandPercentRange | CollectorCompressionTimeout |
ArchiveCompression | ArchiveDeadbandPercentRange |
ArchiveCompressionTimeout | Timeout |
CollectorGeneral1 | CollectorGeneral2 |
CollectorGeneral3 | CollectorGeneral4 |
CollectorGeneral5 | ReadSecurityGroup |
WriteSecurityGroup | AdministratorSecurityGroup |
Calculation | CalculationDependencies |
Acked | Condition |
SubCondition | EventCategory |
Message | Source |
Severity | StartTime |
EndTime | TimestampType |
SpikeLogic | SpikeLogicOverride |
InterfaceAbsoluteDeadband | InterfaceAbsoluteDeadbanding |
LastModified | LastModifiedUser |
ArchiveAbsoluteDeadband | ArchiveAbsoluteDeadbanding |
StepValue | Value |
SpikeLogic | SpikeLogicOverride |
NumberOfElements | CalcType |
- Acked
- Acktime
- Actor
- AlarmID
- Condition
- DataSource
- Enabled
- EndTime
- EventCategory
- ItemID
- Message
- Quality
- Severity
- Source
- StartTime
- SubCondition
- Tagname
- Timestamp
A CSV File that Imports Tags
[Tags]
Tagname,Description,DataType,HiEngineeringUnits,LoEngineeringUnits
TIGER.IMPORT_TAG1.F_CV,Import Tag 1,SingleFloat,35000,0
TIGER.IMPORT_TAG2.F_CV,Import Tag 2,SingleFloat,35000,0
TIGER.IMPORT_TAG3.F_CV,Import Tag 3,SingleFloat,35000,0
TIGER.IMPORT_TAG4.F_CV,Import Tag 4,SingleFloat,35000,0
TIGER.IMPORT_TAG5.F_CV,Import Tag 5,SingleFloat,35000,0
TIGER.IMPORT_TAG6.F_CV,Import Tag 6,SingleFloat,35000,0
TIGER.IMPORT_TAG7.F_CV,Import Tag 7,SingleFloat,35000,0
TIGER.IMPORT_TAG8.F_CV,Import Tag 8,SingleFloat,35000,0
TIGER.IMPORT_TAG9.F_CV,Import Tag 9,SingleFloat,35000,0
TIGER.IMPORT_TAG10.F_CV,Import Tag 10,SingleFloat,35000,0
A CSV File that Imports Data and Data Quality
[Data]
Tagname,TimeStamp,Value,DataQuality
TIGER.IMPORT_TAG1.F_CV,7/20/01 11:07,1,Good
TIGER.IMPORT_TAG1.F_CV,7/20/01 11:08,2,Good
TIGER.IMPORT_TAG1.F_CV,7/20/01 11:09,3,Good
TIGER.IMPORT_TAG1.F_CV,7/20/01 11:10,4,Good
TIGER.IMPORT_TAG1.F_CV,7/20/01 11:11,5,Bad
TIGER.IMPORT_TAG1.F_CV,7/20/01 11:12,6,Bad
TIGER.IMPORT_TAG1.F_CV,7/20/01 11:13,7,Good
TIGER.IMPORT_TAG1.F_CV,7/20/01 11:14,8,Bad
TIGER.IMPORT_TAG1.F_CV,7/20/01 11:15,9,Good
TIGER.IMPORT_TAG1.F_CV,7/20/01 11:16,10,Good
TIGER.IMPORT_TAG1.F_CV,7/20/01 11:17,11,Good
TIGER.IMPORT_TAG1.F_CV,7/20/01 11:18,12,Good
TIGER.IMPORT_TAG1.F_CV,7/20/01 11:19,13,Bad
TIGER.IMPORT_TAG1.F_CV,7/20/01 11:20,14,Good
TIGER.IMPORT_TAG1.F_CV,7/20/01 11:21,15,Good
TIGER.IMPORT_TAG1.F_CV,7/20/01 11:22,16,Bad
TIGER.IMPORT_TAG1.F_CV,7/20/01 11:23,17,Good
A CSV File that Imports Messages
[Messages]
TimeStamp,Topic,Username,MessageNumber,MessageString,Substitutions
28-Aug-2002 19:39:30.567,General,User1,0,A Test Message value 2 with milliseconds,,
28-Aug-2002 19:40:00.000,General,User1,0,A Test Message value 0,,
A CSV File that Imports Tags with Step Values
[Tags]
Tagname,Description,DataType,HiEngineeringUnits,LoEngineeringUnits
TIGER.IMPORT_TAG1.F_CV,Import Tag 1,SingleFloat,35000,0
TIGER.IMPORT_TAG2.F_CV,Import Tag 2,SingleFloat,35000,0
TIGER.IMPORT_TAG3.F_CV,Import Tag 3,SingleFloat,35000,0
TIGER.IMPORT_TAG4.F_CV,Import Tag 4,SingleFloat,35000,0
TIGER.IMPORT_TAG5.F_CV,Import Tag 5,SingleFloat,35000,0
TIGER.IMPORT_TAG6.F_CV,Import Tag 6,SingleFloat,35000,0
TIGER.IMPORT_TAG7.F_CV,Import Tag 7,SingleFloat,35000,0
TIGER.IMPORT_TAG8.F_CV,Import Tag 8,SingleFloat,35000,0
TIGER.IMPORT_TAG9.F_CV,Import Tag 9,SingleFloat,35000,0
TIGER.IMPORT_TAG10.F_CV,Import Tag 10,SingleFloat,35000,0
A CSV File that Imports Alarms
[Alarms]
DataSource,Condition,Source,StartTime,TimeStamp
FileCollector,HI,Mixer,3/10/2005 12:52:02,3/10/2005 12:52:02
FileCollector,HIHI,Mixer,3/10/2005 12:52:02,3/10/2005 12:59:12
A CSV File that Imports Enumerated Set
[EnumeratedSet]
SetName,SetDescription,StateLowValue,StateHighValue,StateDescription,StateName,StateRawValueDataType,
LastModified,LastModifiedUser,AdministerSecurityGroup,NumberOfStatesInThisSet
TestSet5,TestDesc,1,10,State1Desc,State1,DoubleFloat,,,,2
TestSet5,TestDesc,11,20,State2Desc,State2,DoubleFloat,,,,2
A CSV File that Imports Array Tags
[Tags]
Tagname,Description,DataType,HiEngineeringUnits,LoEngineeringUnits,NumberOfElements
TIGER.IMPORT_TAG1.F_CV,Import Tag 1,SingleFloat,35000,0,-1
TIGER.IMPORT_TAG2.F_CV,Import Tag 2,SingleFloat,35000,0,0
TIGER.IMPORT_TAG3.F_CV,Import Tag 3,SingleFloat,35000,0,-1
TIGER.IMPORT_TAG4.F_CV,Import Tag 4,SingleFloat,35000,0,-1
A CSV File that Imports Array Tag Data
[Data]
Tagname,TimeStamp,Value,DataQuality
ArrayTag[0],6/11/2013 09:00:00,1,Good
ArrayTag[1],6/11/2013 09:00:00,2,Good
ArrayTag[2],6/11/2013 09:00:00,3,Good
ArrayTag[3],6/11/2013 09:00:00,4,Good
ArrayTag[0],6/11/2013 09:10:00,5,Good
ArrayTag[1],6/11/2013 09:10:00,6,Good
ArrayTag[2],6/11/2013 09:10:00,7,Good
A CSV File that Imports MultiField Tag Data
[Data]
Tagname,TimeStamp,Value,DataQuality
MultiField.F1,05-22-2013 14:15:00,4,Good
MultiField.F1,05-22-2013 14:15:01,7,Good
MultiField.F1,05-22-2013 14:15:02,9,Good
MultiField.F2,05-22-2013 14:15:00,241,Good
MultiField.F2,05-22-2013 14:15:01,171,Good
MultiField.F2,05-22-2013 14:15:02,191,Good
Note: Before importing MultiField tag data in this format, you must add the User
Defined Type using Historian Administrator and associate that type to the MultiField tag.
Importing s User-Defined Type
The following example allows you to import a user defined type UDT1 with two fields, Field1, Field2. After creating, UDT1 associates with a tag called Mfield.[UserDefinedType]
UserDefinedTypeName,UserDefinedTypeDescription,FieldName,FieldDescription,FieldDataType,IsMasterField,NumberOfFields
UDT1,UDTdesc,Field1,F1desc,SingleInteger,FALSE,2
UDT1,UDTdesc,Field2,F2desc,DoubleInteger,FALSE,2
[Tags]
Tagname,Description,DataType,UserDefinedTypeName
Mfield,mfdesc,MultiField,UDT1
A CSV File that Imports Python Expression Tags
[Tag]
Tagname,CollectorName,CalcType,SourceAddress,DataType,Description
TagDerivedFromRawValue,SimulationCollector,PythonExpr,"{""imports"":[""math""],
""script"":""tag.value + math.pow10,tag.value/70)"",""parameters"":[{""name"":
""tag"",""source"":{""address"":""Simulation00001"",""dataType"":""SingleFloat""}}]}",
SingleFloat,Python Expression Tag example
Note:
- Python Expression tags do not support array or multi-field tags.
- It is important to include the CalcType header and set it to PythonExpr for each Python Expression tag. If the file contains a mix of tags that are Python Expression tags with those that are not, then the tags that are not Python Expression tags must have the CalcType field set to Raw.
- For Python Expression tags, the SourceAddress must contain the tag's minified JSON configuration constructed as described in the topic on Constructing the JSON Configuration for a Python Expression Tag. (Mini- fied JSON has no newline characters or comments. There are tools which can help you minify JSON.)
- Note that the example in the CSV file uses repeated quotation marks ("") in order to escape quotation marks (").
- It is important that your JSON is valid, since no validation will be performed on the JSON at tag creation.