Go to last post Go to first unread
Offline Mark Halder  
#1 Posted : Thursday, January 15, 2015 2:11:01 PM(UTC)
Mark Halder

Rank: Administration

Joined: 10/2/2014(UTC)
Posts: 12

Was thanked: 3 time(s) in 3 post(s)
We currently have remote pipeline stations that we are collecting data from however we want to be able to run calculations on this data and then be able to store these calculations into PI. We are looking to use this data to assist with pipeline leak detection and other pipeline analysis. We have an internal application that contains some complex calculations that we would also like to leverage and was wondering if the OPC Calculator would be able to help with this.
Here are some questions we have on the product.

1. Is there a function block to calculate a Running average?
2. Can you incorporate an external DLL to do some calculations? (basically call that external DLL and then pull in the results from the function call) If this is a possibility then is there a problem if the DLL is running managed code as I think that the OPC Calc is running unmanaged code.
3. Can you create the configuration for Calc on one machine and then download this configuration to a separate machine for the actual running engine?
4. Does Matrikon have use cases that we can share with them for different scenarios that customers are using this product for?
5. What is the performance of OPC Calc? Shell are currently needing the calculations to run every 500ms for 3-4 tags and 1-2 outputs.

1. Yes, in the Statistics section of the blocks menu, use the “Statistics” block and use the “mean” output. See below for more.
2. This is not currently possible but we are looking to implement this in the future. What you can do in this case however is define a custom function block within OPC Calculator that contains different calculations. Using this type of super block you can structure very complex calculations and then re-use this function block as many times as you want within your configuration. This way you can re-create the calculations that you have defined in this custom DLL
3. Yes, the engine can run remotely to the designer.
4. The only use case I can share currently is one that we have implemented for a customer in Asia. They are currently using OPC Calculator to assist with Control Performance Monitoring in their refinery.
5. This is no problem at all, but would depend on the OPC Server and PC performance. It should be able to do up to 400 tags at 500mS.

Below is also a list of the statistic operations that you can perform in the product. Using these functions you can generate the running average.

- in: The scalar input signal.
- reset: Reset pin. (Optional)

- mean: The current mean of the input.
- Var: The variance (σ^2) of the input. (Optional)

- SD.: The standard deviation (σ) of the input. (Square root of variance.) (Optional)

- Int: The interval over which the current outputs have been calculated. (Optional)

- IAE.: The Integral of the absolute error (Optional)

- Execution Interval: Period between successive executions in Seconds.

- Operating Mode: Can be one of three modes:
o Continuous: The output is a continuous calculation of all input samples from the last reset based upon an exponential (decay) window.
Thus, the Operating Interval value becomes the first order lag time constant for the windowing process. This is an approximation to the exact calculations, which require storage of all data (and recalculation of the values at each interval), but has the advantage of taking into account true changes in the signal properties by taking more notice of recent data than old data.
o Stationary Interval: The output is the calculated based on the input for a fixed interval in time. After each Operating Interval, the previous data is thrown away and a new calculation begun.
o Moving Interval: The output is always the calculated on the last Operating Interval period. After reset the output is the calculated since the reset occurred until one Operating Interval of time has passed.
- Operating Interval: The interval (in seconds) over which the calculations are performed.
In “Continuous” mode this is the time constant of the exponential windowing operation. In other modes the actual number of points over which the analysis is performed is calculated as Operating Interval/Execution Interval.
- Output Update Mode: Only relevant in “Stationary Interval” mode. The options are:
o Continuous: The output is always the most recent calculation. Just after the beginning of a new interval, the output value will be the analysis of only a few (minimum 2) values of the input.
o End of Interval: In this mode, the outputs reflect the values of the last complete interval. Immediately after reset, the outputs take on the Initial values.
- Initial Mode: Selection “Grow” or “Full”. This sets the initial mode of the statistics. In Grow mode the blocks grows the size of the number of variables being used to create the statistics until the size specified by Operating Interval. In Full mode the block initialises as if the initial values have been on the input for the full Operating Interval before the initialisation.
- Initial Mean: This is the initial mean output for “Continuous” mode and the “Stationary Interval” mode when the output update mode is set to “End of Interval”. Also the mean value generated by all modes after reset until two samples are received (unless “Full” mode is specified).
- Initial Variance: This is the initial variance (and so also Standard Deviation) output for “Continuous” mode and the “Stationary Interval” mode when the output update mode is set to “End of Interval”. Also the value generated by all modes after reset until two samples are received – ignored if Full mode is specified.
- Initial Absolute: This is the initial IAE output for “Continuous” mode and the “Stationary Interval” mode when the output update mode is set to “End of Interval”. Also the value generated by all modes after reset until two samples are received. Ignored if “Full” mode is specified
- Reset State: Reset on True or False input.
- Edge Trigger: Reset only on first transition to Reset State (True) or reset every execution interval when at Reset State (False).
- Upper Input Threshold: The upper limit of the region of possible input values that is interpreted as logic HIGH.
- Lower Input Threshold: The lower limit of the region of possible input values that is interpreted as logic HIGH.

The Moving Interval and Stationary Interval modes require the use of a memory buffer to store all the samples in the interval. The maximum allowable size of the interval will be dependent on the computer loading and memory availability. If the required memory is not available, the block code will convert to the “Continuous” mode and generate a run-time message to this effect. This may or may not be acceptable.
Also try to ensure (in Moving Interval and Stationary Interval modes) that the Operating Interval is not excessively big for the schematic’s Execution Interval since a new mean, and thus variance, must be calculated during certain (sometimes all) executions of the block. This can be a significant calculation for large values of Operating Interval.

Since the sample variance requires the number of samples (n) to be greater than 2, the values of out, s.d. and mean corresponding to the first sample of an interval will be the previous value (or Initial values for the first sample since a reset has occurred).
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Matrikon Subscribe  |   Matrikon Unsubscribe  |   Global Unsubscribe  |   Privacy Statement  |   Do Not Sell My Personal Information