For the ODBC collector to interpret the received data accurately, you must map the format and structure of
the data between the ODBC server and Historian.
Procedure
Access the ODBC_Mapping.xml file. By default, this file is
located at C:\Program Files\GE Digital\Historian ODBC
Collector\Server. In the ODBC collector registry path, this file is stored in the Mapping File variable.
For each data type in the ODBC server, add an entry in the equivalent Historian
data type as described in the following table. If a Historian data type does not
have an equivalent ODBC data type, enter *NA*.
Historian Data Type
ODBC Server Data Type
ihByte
Byte
ihFloat
SingleFloat
ihDoubleFloat
DoubleFloat
ihInteger
SingleInteger
ihDoubleInteger
DoubleInteger
ihScaled
*NA*
ihFixedString
*NA*
ihVariableString
*NA*
ihBlob
*NA*
ihTime
*NA*
ihInt64
*NA*
ihUInt64
*NA*
ihUInt32
*NA*
ihUInt16
*NA*
ihBool
*NA*
For example, if the ODBC server contains a Float data type named ID, enter
<ihFloat>ID</ihFloat>
In the Quality and SubQuality elements, provide the range of values retrieved
from the quality column. For quality elements that are not applicable, enter
*NA*.
For example, if the values from 0 to 97 are considered as bad quality, and
if the numbers from 98 to 100 are considered as good quality, provide the values
as
follows:
In the TagInfo element, provide the tag details, which are used to browse for
tags. Provide the column names available in the ODBC server in the corresponding
tag element.
<TagInfo>
<DBName>DB1</DBName> <!--Cannot be *NA*-->
<TableName>Temperature</TableName> <!--Cannot be *NA*-->
<TagName>Boiler_Temp</TagName> <!--Cannot be *NA*-->
<Description>*NA*</Description>
<EngineeringUnits>*NA*</EngineeringUnits>
<DataType>*NA*</DataType>
<MinimumEngineeringUnit>*NA*</MinimumEngineeringUnit>
<MaximumEngineeringUnit>*NA*</MaximumEngineeringUnit>
</TagInfo>
Note: If you enter *NA* for the DataType element, you can provide only one
data type mapping for the DataTypeMapping element and all the remaining
elements must be marked *NA*
You can choose to automatically run
queries from the info you provide in the TagInfo element. To do so, enter
<Mode>1<Mode> in the TagInfo element. If you want to
provide queries manually, enter <Mode>0<Mode> in the
TagInfo element.
In the DataInfo element, provide the tag data details, which are used to create
a query to collect the data.
<DataInfo>
<DBName>DB1</DBName> <!--Cannot be *NA*-->
<TableName>Temperature</TableName> <!--Cannot be *NA*-->
<TagName>Boiler_Temperature</TagName> <!--Cannot be *NA*-->
<Timestamp>10-06-26 02:31:29,573</Timestamp> <!--Cannot be *NA*-->
<Value>97</Value> <!--Cannot be *NA*-->
<Quality>good</Quality> <!--Cannot be *NA*-->
<SubQuality>*NA*</SubQuality>
</DataInfo>
You can choose to automatically run queries from the info you provide in the
DataInfo element. To do so, enter <Mode>1<Mode> in the
DataInfo element. If you want to provide queries manually, enter
<Mode>0<Mode> in the DataInfo element.
If you want to provide your own queries, provide them in the following
format:
<Query>
<Browse>SELECT [TagName],[Description],[TagType],[Unit],[MinEU],[MaxEU] FROM [Runtime].[dbo].[TagHistory]</Browse>
<ReadData>SELECT TagName, [DateTime], Value, Quality, QualityDetail FROM History where History.TagName = '?Tagname?' AND wwRetrievalMode = 'FULL' AND wwVersion = 'Latest' AND DateTime > '?Start?' ORDER BY DateTime ASC</ReadData>
<TagCount>SELECT count(*) from [Runtime].[dbo].[TagHistory]</TagCount>
</Query>