Setup registration of production for binary DIAP tags


This guide describes how to setup the registration of a Good, Bad, Total or Rework production counter for tags that are binary. Binary tags that are used for production can regenerate a lot of data, which causes high load on the system. To counter this effect, use the Data source Produced Discrete instead of Produced Items, by doing this, the data gets processed faster and the results will be represented sooner.

We recommend that you contact support

If you are planning to use the Data source Produced Discrete, then please contact DIAP support at:

To ensure that the Data source is going to process the correct type of data. (You will need to know the period structure of your signal)

Produced Discrete

The Produced Discrete data source takes the data from a DIAP tag and passes them as production without calculating the difference between the entries in the data, like the Produced items (Read more about it here Setup registration of production counters) would:

Produced Discrete:

Produced items(Reset value is '0' here, when a lower number is presented):


Produced Discrete used with binary DIAP tags.

The DIAP tags used with the Produced Data source, should send the number of changes from '0' to '1' (number of rising edges) within a interval. This will present the number of produced items within that interval.


Go to the Configuration->Data source page:

Select the unit you wish to setup the registration for (The units here are examples and are different from yours):

Click the Add button:

Select Produced Discrete:

Click Save, to add the event server:

Configuration of Produced Discrete

  • Name: The name of the event server, that is collecting the data.
  • Counter Tag: The DIAP tag is where the production from the binary tag is collected from. The structure of the name is [DIAP]-[PLC]-[Tag]
  • Registration Type: The production type that is used. There are the following type:
    • Good: This type represent the good produced items, that passed quality check and are ready to be used.
    • Bad: This type represent the bad produced items, that failed quality check and are to be discarded.
    • Rework: This type represent the bad produced items, that failed quality check and are to be reworked.
    • Total: This type represent the sum of all production types including Good, Bad and Rework into one count(The DIAP tag has the responsibility, that this counter is the sum of all types).

Counter Tag data type

  • Type: Boolean

Counter Tag live configuration

In the live site under the configuration for the tag make sure that the Datatype is Binary tag (Read more about tags here: Configuration of tags (PLC)):

And the Raw or counted is counted:

And the Counter Reset is Interval(s):

And set Reset Interval(s) to at least 5 seconds(Longer intervals means less data to process in the cloud):

With this the tag sends the number of changes from 0 to 1 (Rising edges) in intervals with the length of Reset Interval(s) instead of the raw data. This is what optimizes the data collection, by reducing the amount of data send and summarize them into the intervals.

Scan rate

It is very important that the scan rate is set to a high enough frequency, if it is set too low the value changes on the tag can be missed, when the data is read. To ensure that all the data is read, the scan rate should be set to twice as fast, as the the smallest part of a period on the signal. For example if a signal is '1' for 2000 milliseconds and '0' for 1000 milliseconds in a period, then the scan rate should be max 500 milliseconds.

Closing Reset interval period

The data is sent to the cloud when the reset interval period is closed, this happens on the first value change after the period has occurred. For example if the Reset interval is set to 5 seconds and the reset interval started at 13:00:00, then the data is sent, when the first value change after 13:00:05 has occurred.


This is also important, because if the signal doesn't change it's value after the last product of the day, you won't see the data in the Live or OEE sites, before you start the production again.  Now you can't see when the reset interval period starts, but you can change the value a Reset Interval period after the last production to ensure, that you will see the data the on the Live or OEE sites  for the day. For example if the Reset interval is set to 5 seconds, then 5 seconds after the last production you change the value of the signal from 1 to 0:

Example - Configure a good discrete production counter

Select a name for the event server, that is collecting the data. Here we called it "Good discrete produced items":

Select the DIAP tag, where the data comes from. Here we selected "dev-00225-2 - Demo - Tag1":

(You can type in this box to quicker search for the tag):

Set the registration type to "Good":

When you are done, the configuration should look something like this (But with your values):

Click Save to save the configuration:

Now you have a configuration for one data entry on a unit, if you want more, then you have to configure one for each data entry you want, like for example if you want one for good production items and one for bad production items, then you need a configuration for the good one and one configuration for the bad one.

Start collecting data

When you have made your configurations in the Data source, then you need to start the event server for the configuration, so the data get collected.

Go to the Configuration->Data source status page:

Select your unit:

Click the switch for the event server with the configuration:

Then the light turns green and the Last run timestamp is updated, when your event server has run your configuration for the first time:

That it. Now your configuration are done and you are collecting data.