Configuring the ODBC Collector

Configure ODBC collector

About this task

Configuring ODBC collector involves the following steps.

Procedure

  1. Establish connection to ODBC Source by providing ODBC Server Name, User Name and Password. Refer to Establish Connection to ODBC Source
  2. Configure the ODBC Mapping file by providing all the mandatory details in the Mapping file. Refer to ODBC Data Collector Mapping
    Note: Only after configuring ODBC Server and ODBC_Mapping.xml file, user will be able to run the ODBC collector.

Establish Connection to ODBC Source

Procedure

  1. Select ODBC collector from the list of collectors on the Proficy Historian Administrator window.
  2. Select Configuration.
    The following page appears:

  3. Enter the appropriate values in the field of Collector Specific Configuration (Custom) Section.
    Table 1.
    FieldDescription
    Server NameODBC Server Database Server name.
    User NameODBC Server Database User name.
    PasswordODBC Server Database password.
    Recovery Time (hours)

    Recovery logic is activated when the ODBC Data Collector and ODBC Historian re-establish a connection after a connection loss, or when the ODBC Data Collector is started.

    The ODBC Data Collector attempts to recover all data samples between the current time and the last known write time, up to a maximum number of hours configured for the collector. Continuous collection resumes only after the previous data has been recovered.

    Note: The default recovery time is 0 hours.

    Refer to Configuring Recovery Time for the GE Data Collector for Wonderware

    Throttle (Milliseconds)

    Frequency of ODBC data polling.

    To minimize the load on the ODBC Server, the configurable throttling option is provided by the GE ODBC collector. By default, GE ODBC collector tries to query the tag data every 100 milliseconds based on the collection interval time. You can change this value to any time between 100 milliseconds to 16 hours.

    Note: If Throttle field is blank, enter the required minimum value of 100 milliseconds.

    Refer to Configuring a Throttle Value

Configuring Recovery Time for the GE Data Collector for Wonderware

Procedure

  1. Start Historian Administrator.
  2. Select the Collectors page.
  3. Select the GE Data Collector for Wonderware.
  4. Select Configuration.
  5. In the Recovery Time field, enter a recovery time in hours.

Configuring a Throttle Value

Procedure

  1. Start Historian Administrator.
  2. Select the Collectors page.
  3. Select the Historian Data Collector for Wonderware.
  4. Select Configuration.
  5. In the Throttle (Milli Sec) field, enter the polled collection interval.
    Note: : If the Throttle field is blank, enter the required value if the value is not 100 milliseconds.

ODBC Data Collector Mapping

Mapping is the process of associating the data format and structure of the source and with the corresponding data format of the collector to be able to interpret the received the data accurately.

Mapping is done using an xml file, ODBC_Mapping.xml. If the ODBC collector is installed in C drive, the Mapping file path will be stored as

<C:\Program Files\GE Digital\Historian ODBC Collector\Server\ODBC_Mapping.xml>

in the MappingFile variable of ODBC collector registry path. The Mapping file is shipped with the installer. This section explains the parameters of the file in detail.

<Mapping>

DataTypeMapping is used to match the historian data types with corresponding ODBC source data types. The data types which does not have any mapping in ODBC source should be added as "*NA*".

For Example: If the source contains data type named "Test" which is of Float type, then Test would be mapped to ihfloat.

<DataTypeMapping>
		<ihDataTypeUndefined>*NA*</ihDataTypeUndefined>
		<ihScaled>*NA*</ihScaled>
		<ihFloat>1</ihFloat>
		<ihDoubleFloat>*NA*</ihDoubleFloat>
		<ihInteger>2</ihInteger>
		<ihDoubleInteger>*NA*</ihDoubleInteger>
		<ihFixedString>*NA*</ihFixedString>
		<ihVariableString>3</ihVariableString>
		<ihBlob>*NA*</ihBlob>
		<ihTime>*NA*</ihTime>
		<ihInt64>*NA*</ihInt64>
		<ihUInt64>*NA*</ihUInt64>
		<ihUInt32>*NA*</ihUInt32>
		<ihUInt16>*NA*</ihUInt16>
		<ihByte>*NA*</ihByte>
		<ihBool>*NA*</ihBool>
		<ihMultiField>*NA*</ihMultiField>
		<ihArray>*NA*</ihArray>
	</DataTypeMapping>

Quality and SubQuality tag elements are used to provide the range of values, retrieved from quality column, to be considered for intepreting the quality.

For Example: If the values from 0 to 97 has to be considered as a bad quality and from 99 to 100 has be to considered as the good quality then the Quality tag should be as follows.
Note: Not applicable quality elements should be marked as "*NA*"
<Quality>
	<ihOPCBad>[0,98)</ihOPCBad>
		<ihOPCUncertain>*NA*</ihOPCUncertain>
		<ihOPCNA>*NA*</ihOPCNA>
		<ihOPCGood>[99,101)</ihOPCGood>
	</Quality>
	
	<SubQuality>
	<ihOPCNonspecific>*NA*</ihOPCNonspecific>
		<ihOPCConfigurationError>*NA*</ihOPCConfigurationError>
		<ihOPCNotConnected>*NA*</ihOPCNotConnected>
		<ihOPCDeviceFailure>*NA*</ihOPCDeviceFailure>
			<ihOPCSensorFailure>*NA*</ihOPCSensorFailure>
		<ihOPCCommFailure>*NA*</ihOPCCommFailure>
		<ihOPCOutOfService>float</ihOPCOutOfService>
		<ihScaledOutOfRange>*NA*</ihScaledOutOfRange>
			<ihOffLine>*NA*</ihOffLine>
		<ihNoValue>*NA*</ihNoValue>
		<ihCalculationError>*NA*</ihCalculationError>
		<ihConditionCollectionHalted>*NA*</ihConditionCollectionHalted>
		<ihCalculationTimeout>*NA*</ihCalculationTimeout>
	</SubQuality>

Mapping file can automatically frame the queries from the provided input in the TagInfo and DataInfo tags. In addition, User is provided with flexibility to disable this feature and provide the manual queries

To enable Manual mode: Mode value should be "0"

To enable auto mode: Mode value should be "1", which is by default.

<Mode>0</Mode>
Taginfo is used to map the tag details, which are used to browse the tags. The column names present in the source database should be provided in the corresponding tag element so that collector would use this information to frame the query.
<TagInfo>
		<DBName>*NA*</DBName> <!--Cannot be *NA*-->
		<TableName>*NA*</TableName> <!--Cannot be *NA*-->
		<TagName>Test</TagName> <!--Cannot be *NA*-->
		<Description>*NA*</Description> <!--If not applicable mark it as "*NA*"-->
		<EngineeringUnits>*NA*</EngineeringUnits> <!--If not applicable mark it as "*NA*"-->
		<DataType>*NA*</DataType>    <!--If not applicable mark it as "*NA*", However, when DataType is *NA*, Only one data type mapping can be done in <DataTypeMapping> section and all the rest shall be marked as *NA*-->
		<MinimumEngineeringUnit>*NA*</MinimumEngineeringUnit><!--If not applicable mark it as "*NA*"-->
		<MaximumEngineeringUnit>*NA*</MaximumEngineeringUnit><!--If not applicable mark it as "*NA*"-->
	</TagInfo>

DataInfo is used to get the data and the column names present in the source database should be provided in the corresponding tag element so that collector would use this information to frame the query.

<DataInfo>
		<DBName>*NA*</DBName> <!--Cannot be *NA*-->
		<TableName>*NA*</TableName> <!--Cannot be *NA*-->
		<TagName>Test</TagName> <!--Cannot be *NA*-->
		<Timestamp>*NA*</Timestamp> <!--Cannot be *NA*-->
		<Value>*NA*</Value> <!--Cannot be *NA*-->
		<Quality>*NA*</Quality> <!--Cannot be *NA*-->
		<SubQuality>*NA*</SubQuality> <!--If not applicable mark it as "*NA*"-->
	</DataInfo> 

The queries framed by the collector would be reflected in the below Tag.

If the manual mode has been selected, User must provide the query in the corresponding elements.

If Auto mode is enabled, Collector would automatically generate the query and fills the below elements for further reference.

All the following files are mandatory and "*NA*" cannot be used here.

<Query>
    <Browse></Browse>
    <ReadData></ReadData>
    <TagCount></TagCount>
</Query>
</Mapping>
Example:
<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 &gt; '?Start?' ORDER BY DateTime ASC</ReadData>
<TagCount>SELECT count(*) from [Runtime].[dbo].[TagHistory]</TagCount>
</Query>