Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

AVEVA™ Manufacturing Execution System 2023 R2

Configure rolling counter attributes

  • Last UpdatedDec 03, 2024
  • 6 minute read

You can configure a rolling counter to count the items that are consumed and to update the consumption count when items are being consumed at run time.

A rollover counter is typically used in manufacturing operations for which a value for production or consumption is needed using a device like a PLC or other counting device that either through manual or automatic action resets its value to 0. For example, a counter might need to be reset if it can contain only 4 digits or if there is a maximum count such as 32,767. So at a certain point the counter would reset to a lower number between update intervals in the OCO. The OCO understands this resetting and it knows how to calculate the counts required based on the last known value and the current value. The OCO can also reset a counter at the start of a shift in order for the production crew to understand their production for the shift.

The rolling counter option is disabled if you do not have any consumption counter instances that are created or if you do not select a consumption counter instance.

Enable the rolling counter option

  • In the Rolling Counter Attributes select, select the Enable Rolling Counter check box.

    The OCO object editor rolling counter attribute and command settings.

To retrieve the value of an attribute from other object instance, you must select the corresponding Use Input Source check box. When you select the Use Input Source check box, the default value and the browse button appear in the corresponding attribute box.

Use the following attributes to configure the rolling counter.

Add Consumption Quantity Counter

The initial quantity to start the consumption count or a reference to the input source that will be read when the object first goes on scan. This quantity is updated when the items are consumed at run time.

Note: You must specify the justified required values for all the rolling counter attributes to avoid the excessive consumption being reported. This affects performance of the database and may cause reporting issues.

Rolling Counter Data: Deadband

The minimum quantity value increase from the last update from this counter that must occur before logging the new quantities recorded by the counter. The default value is 1.

It is recommended to specify a non-zero value for the Deadband attribute to avoid logging every single production.

Rolling Counter Data: Update Interval

The time interval that must be passed after logging the previous consumption and before logging the new quantities recorded by the counter. The default value is 00:01:00.0000000 (1 minute of elapsed time for each consumption).

It is recommended to not specify the 00:00:00 value for the Update Interval attribute, as this could trigger transactions every scan of the object.

Rolling Counter Data: Max Value

The maximum quantity value that the counter can record. For example, if the maximum value is set to 100 and the counter value is 98, when the counter is next updated and the counter value is 5, then the consumption value is set to 7.

Do not configure the maximum value as 0 because the counter will never reset.

The rolling counter logs consumption data only when the values configured for the Deadband and Update Interval attributes are reached.

The following table describes the functioning of the rolling counter for which the Deadband is 10 (10 quantities), Update Interval is 00:00:30 (30 seconds), and Max Value is 100:

Current Time

Counter Value

Deadband Value Reached

Time Interval Reached

Qty to Be Logged

Comments

12:00:00 AM

1

No

No

0

The consumption quantities are not logged because the current quantity is less than the deadband value of 10, and the time interval is less than 30 seconds since last consumption.

12:00:10 AM

6

No

No

0

Same as above.

12:00:12 AM

12

Yes

No

0

The consumption quantities are not logged because the time interval is not reached even though the deadband value of 10 is exceeded.

12:00:22 AM

24

Yes

No

0

Same as above.

12:00:30 AM

24

Yes

Yes

24

A consumption quantity of 24 is logged because the quantity of 24 exceeds the deadband value 10, and the time 12:00:30 AM satisfies the time interval limit of 30 seconds (started at 12:00:00 AM).

12:00:42 AM

27

No

No

0

The consumption quantities are not logged because the quantity difference is less than deadband value, and the time interval limit did not exceed after the last logged production. For this instance, current counter value of (27)- Last logged consumption quantity (24) = 3. A quantity difference of at least 10 is required before logging the consumption counts.

12:00:56 AM

32

No

No

0

Same as above.

12:01:02 AM

32

No

Yes

0

The consumption quantities are not logged because the quantity difference is less than the deadband value, though the time interval limit is exceeded since last consumption.

12:01:34 AM

33

No

Yes

0

Same as above.

12:01:38 AM

34

Yes

Yes

10

A consumption quantity of 10 is logged as the deadband value is reached and time interval value is already reached.

12:03:10 AM

5

Yes

Yes

71

A consumption quantity of 71 is logged because the quantity recorded by the counter exceeds the deadband and time interval values after last consumption.

Rolling Counter Data: Push Consumption Counts Upon Reset

Specifies whether to log the pending consumption count that is recorded after resetting the counter. The count recorded is the value since the last update before the reset occurs.

If you do not select this check box and the Reset command is triggered, the counter value is set to 0 and the recorded counts are not logged.

Current Time

Counter Value

Deadband Value Reached

Time Interval Reached

Qty to Be Logged

Comments

12:01:38 AM

34

Yes

Yes

10

A consumption quantity of 10 is logged as the deadband value is reached and time interval value is already reached.

12:03:10 AM

5

Yes

Yes

71

A consumption quantity of 71 is logged because the quantity recorded by the counter exceeds the deadband and time interval values after last consumption.

12:04:05 AM

12

No

Yes

0

Consumption quantities are not logged because the time interval is not reached, though the deadband value of 10 is exceeded.

When the ResetRollingCounterCmd is triggered at 12:05:02 AM, the counter value is reset to 0. If the PushConsumptionCountsUponReset attribute is set to True, the pending quantity of 7 (Current Counter Value 12 - Last Counter Value 5) is logged. Otherwise, the quantities (e.g., 7 in the example above) are ignored.

When a job is paused or ended from the OCO, the pending counts from the counters are always recorded. Additionally, pending counts are also logged when a value for one of the following attributes changes: item, BOM position, consumption reason, storage location, lot number, or sublot number.

Resetting the Rolling Counter with External I/O Configured for Reset Commands

When a rolling counter is linked to an external I/O that is configured to support count Reset commands, the following script must be added to reset the value of the I/O counter to a 0 quantity without dropping consumption counts:

Expression: Me.ResetRollingCounter

Trigger Type: OnFalse

Script:

MyContainer.RollingConsCounter = 0;

where MyContainer.RollingConsCounter is the input source that is being read.

Without this script, it is possible that the counter tag will reset to 0 before the OCO receives the reset rolling counter command and will record a larger quantity thinking the counter has rolled over. By adding a script to detect the reset rolling counter command and have the script set the input source to 0, the transaction order is properly maintained.

For example, consider the following sequence with Push Production Counts Upon Reset set to true and the indicated script added:

  1. The current rolling counter value is 10.

  2. This consumption count of 10 is recorded.

  3. The rolling counter increases to 13 but the interval time has not expired as of yet to record the additional consumption of 3.

  4. A Reset counter command is issued.

  5. The additional consumption of 3 is expected to be recorded.

    If the I/O counter is also set to 0 at the same time the reset command is issued, it is possible that a rollover quantity will be recorded instead of the 3 units. With the script, the I/O counter is set to 0 after the reset command has completed and only reported the 3 units.

  6. The OCO rolling counter is reset to 0.

  7. The I/O counter is reset to 0.

  8. The next scan cycle will initialize the OCO counter to 0 (i.e., the value from I/O) with no consumption added.

  9. The next increment of the rolling counter will add consumption starting from 0.

TitleResults for “How to create a CRG?”Also Available in