Troubleshoot Calculation Collector

Troubleshooting Calculation collector

About this task

If you observer errors with Calculation collector, you should:

Procedure

  1. Examine the collector log files in the Historian\LogFiles folder and scan for errors in the log that may explain your problem.
  2. Check the connection to the source.
    For example, if you lose connection to the source, all tags for that collector stop collecting. What that means is that even if you hard-code the formula results, the collector will not collect them. If you enter a formula such as result=7 on a polled, 1-second tag in the Server-to-Server Collector, Historian does not log any raw samples to the destination computer. This action occurs even though the result is hardcoded.
  3. Ensure that you are following the guidelines described in General Guidelines for Designing a Calculation Formula.
    Tip: use the LogMessage function to include messages in your formula when certain points of a calculation executes so that you can isolate errors. Refer to Writing Messages to the Collector Log File for Debugging Purposes for details.

Unsupported Data Types for Calculation Tags

Calculation tags with Quad Integer and Unsigned Quad Integer data types return bad quality values due a limitation in Visual Basic (VB).

Unsupported Calculations in Calculation collector

Calculation collector supports only the calculations performed using the current value calculation. It does not support other calculations due to a Visual Basic script limitation.

Writing Messages to the Collector Log File for Debugging Purposes

If you want to include debugging messages after certain parts of your formula execute, you can you can use the LogMessage function when creating a formula in the Calculation pane. The syntax of this function is as follows:

LogMessage(message_string)

where message_string is the message that you want to appear in the log file for the Calculation or Server-to-Server Collector. If the message_string is not a string variable, use double quotes around the text for message_string value. For instance, a properly formatted text string with double quotes would appear like this:

LogMessage("This is a message")
Note: The LogMessage function does not appear in the wizard.

Importing Calculations with Line Breaks into Historian

About this task

You can import calculations with line breaks into Historian when you use the File collector or the Excel Add-in.

Procedure

  1. To create a line break in a .CSV file for the File collector, you insert the *CR* character sequence where you want each line break to occur.
  2. To create a calculation with multiple lines in Excel, press Alt+Enter at the end of each line where you want a line break to occur within a cell.
    You can also use the *CR* character sequence to denote a line break in the formula.

    Example of a .CSV File that Includes a Calculation with Multiple Lines

    In the following example the bold *CR* characters identify where the line breaks occur in the calculation formula.
    [Tags]
    
    Tagname,Description,DataType,HiEngineeringUnits,LoEngineeringUnits,Calculation,
    CollectorType,CollectorName,CollectionType,CalculationDependencies
    CalTag16,Multiline calc tag sample,SingleFloat,35000,0, "'multiline calc comment*CR*IF CurrentQuality
    (^Fixlab15.simulation00001^)=100 THEN*CR*Result=CurrentValue(^Fixlab15.simulation00002^)
    *CR*END IF",Calculation,Fixlab15_Calculation,Unsolicited,Fixlab15.simulation00001
    Important: For this example to work, only include three line breaks: one after the word [Tags], one after the word CalculationDependencies on line 3, and one at the very end of the example. It is important that the last 4 lines of this example all appear on the same line in the actual .CSV file. The example only includes extra line breaks so that the text is more easily readable, and does not flow off the page.

Recovery Mode (Calculation collector)

Recovery logic is activated when the Calculation collector and Historian Server reestablish connection after a connection loss. Recovery mode allows the collector to recover data when the connection between the collector and the server is reestablished. Recovery mode produces calculated values for time when the Calculation collector was not running.

When using recovery mode, all referenced tags in an unsolicited calculation must be listed as trigger tags. For more information, refer to About Recovery Mode.