Proficy Historian Client Access API
In This Topic
    Proficy.Historian.ClientAccess.API Assembly
    In This Topic

    The Historian Client Access API is a Microsoft .NET framework 4.0 assembly designed to enable connectivity to Historian servers for purposes of application development. It exposes the following Historian functionality:


    • Data query and insertion

    • Tag query, creation and management

    • Message query

    • Archive file query, creation and management

    • Collector query and management

    • Historian server enquiry and administration.
     

    Configuration options include:

    • To change the default port

    • To increase concurrent connections

    • To configure connection timeout

    • To enable debug mode

     Configuration Examples

    Port Configuration

    To change a port number, add the port number to the ihDataArchiver_x64.exe.config file.  Currently, you can only change the port number to 13001. For example, here are the lines you would use to add the 13001 port to the configuration file:

    <configuration>
    <appSettings>
    <add key="TcpPortNumber" value="13001"/>
    </appSettings>
    </configuration>

    Next, you need to do same thing for your Client program so that the Client knows to connect to port 13001. Using the Client access API sample as an example, create a HistorianCSharp.exe.config file and put the following lines in it:

    <configuration>
    <appSettings>

    <add key="TcpPortNumber" value="13001"/>

    </appSettings>

    After a restart, your program should now connect. The connection on port 13001 should also display in netstat. For example:

    [fe80::7181:64af:80b2:13f6%10]:13001 CPWIN7N:49194 ESTABLISHED

    NOTE: If the ihDataArchiver_x64.exe.config file does not exist, you will need to create one using with a text editor like NotePad. Changes to this configuration get applied after a restart of the Data Archiver service. On a 32-bit operation system, you need to add/modify the ihDataArchiver.exe.config file.

     

    Concurrent Connections Limits

    To increase your current connections, edit the ihDataArchiver_x64.exe.config file, the MaxConcurrentSession and MaxConcurrentInstances keys. In the following example, this value is increased from 200 (the default) to 250.

    <?xml version="1.0" encoding="utf-8" ?>
    <configuration>
        <appSettings>
            <add key="MaxConcurrentSessions" value="250"/>
            <add key="MaxConcurrentInstances" value="250"/>
            <add key="MaxReceivedMessageSize" value="10485760"/>
            <add key="MaxItemsInObjectGraph" value="100000"/>
            <add key="OpenTimeout" value="0:5"/>
        </appSettings>
    </configuration>

    NOTE: If the ihDataArchiver_x64.exe.config file does not exist, you will need to create one using with a text editor like NotePad. Changes to this configuration get applied after a restart of the Data Archiver service. On a 32-bit operation system, you need to add/modify the ihDataArchiver.exe.config file. 

    Connection Timeout Settings

    To configure a connection timeout, edit the ihDataArchiver_x64.exe.config file and add the ReceiveTimeOut key to change the default timeout. The ihDataArchiver_x64.exe.config file should be located in the same location as the ihDataArchiver_x64.exe file. The following example sets "ReceiveTimeOut" to 12 hours, which is the longest time that WCF service accepts:

    <?xml version="1.0" encoding="utf-8" ?>
    <configuration>
    
       <appSettings>
           <add key="TraceLevel" value="Info"/>
           <add key="MessageLogging" value="On"/>
           <add key="ReceiveTimeout" value="12:0"/>
        </appSettings> 
    
    </configuration>
    

    The 2 lines in the example that add "TraceLevel" and "MessageLogging" are not necessary; they are for debugging purposes.

    NOTE: If the ihDataArchiver_x64.exe.config file does not exist, you will need to create one using with a text editor like NotePad. Changes to this configuration get applied after a restart of the Data Archiver service. On a 32-bit operation system, you need to add/modify the ihDataArchiver.exe.config file.

    Debug Mode

    You can obtain additional logging for the Data Archiver (such as for connect messages that are failing) by modifying the TraceLevel and MessageLogging keys in the ihDataArchiver_x64.exe.config file as shown in the following example. 

    <?xml version="1.0" encoding="utf-8" ?>
    <configuration>

    <appSettings>
    <add key="TraceLevel" value="Info"/>
    <add key="MessageLogging" value="On"/>
    </appSettings> 

    </configuration>

    The values for the Tracelevel include: Debug, Trace, Info, Warn, Error, and Fatal.  The Debug setting will create the most logged data. The Info setting is usually enough to catch most errors. If not using the Info level, after you've finished capturing the logs, be sure to set the level back to the default of "Info". Otherwise, leaving the log at a level of "Debug" can impact performance.

    Restart the Data Archiver to begin viewing the log. Historian will write the logs in the format of: messages-00.log, in the Historian log files folder. By default, you can find these logs in the Historian Data\LogFiles folder.

    NOTE: If the ihDataArchiver_x64.exe.config file does not exist, you will need to create one using with a text editor like NotePad. Changes to this configuration get applied after a restart of the Data Archiver service. On a 32-bit operation system, you need to add/modify the ihDataArchiver.exe.config file.

     

    Namespaces
    NamespaceDescription