Totalizer

<< Click to Display Table of Contents >>

Navigation:  Strategy Controller >

Totalizer

Previous pageReturn to chapter overviewNext page

 

Some instruments have a built-in totalizer. But if this is not the case then SpecView's Strategy Controller can be configured to do this for you.

However, it is important to consider what it is that you need SpecView to do, for example:

When should the totalizer result be reset back to zero?
What is it that is being measured?

- If the instrument does an on/off for every unit of consumption then these can be counted.

- If the value is a flow-rate then the calculation needs to be done carefully to ensure that the total is a true one.

 

A basic totalizer would need a SpecView Number User Variable to store the running-total

and a Strategy Controller event which would add the current value to the running-total.

 

Totalizing a flow-rate is more like calculating an average. However, it is particularly important to have thoroughly thought through exactly what is needed:

What are the units of the flow rate?
Is the flow generally constant or rapidly changing?
How often should the flow-rate be sampled?
Over what period of time will the totalizer run for, such as, over a few minutes or maybe over a few days.
At what stage should it be reset?
Should the reset be done automatically or manually by the operator?
How accurate does the total value need to be?
Should the total value be marked for logging?

 

Here's an example of a flow-rate in litres per minute, where the flow-rate is added up every second and at the end of each minute divided by 60 & added to the total:

 

Create an 'every second' event (see the note below), with the action to add the current value of the flow-rate to the running-total.

Create an 'every minute' event, with the action to divide the running total by 60 & add the result to the total. (For the constant value 60, create a SpecView Number User Variable called 'Sixty' and set the initial value to 60).

 

To show the duration that the totalizer has been running:

Create two SpecView Time User Variables (call them StartTime and Duration) and when the process starts set StartTime to the Current Time and set both the running-total & the total to zero.
Then add an action to the 'every second' event (which you've already created) to subtract StartTime from SpecView.Time & put the result in Duration.

 

When the values are displayed on the screen (GDW), it maybe that more than one decimal place needs to be shown, this can be changed using Dynamic Attributes.

 

For an example of this please see the Demo projects on the SpecView CD, or contact your SpecView distributor.

 

NOTE: It is recommended that for events that need to 'fire' every second, or every minute a Value based event watching SpecView.Time with a test of 'Changed' by a constant value be used instead of a Time based event using 'Repeat every'.