Skip to main content
Version: 2.7

Advanced Processing Network

Processing network are used to pre-process data on the level of a device or on level of the gateway.

This tutorial is a continuation of Tutorial 2 - DataCorrelation.

Port Coupling

A network of processors must be wired. Typically the wiring connects data nodes and ports with each other to exchange values and states.

There exists two different types of wiring: dynamic and static port wiring.

Dynamic Port Coupling

The dynamic wiring is used to connect outside data nodes with a processing network.

NOTE

The dynamic wiring has a big advantage: it completely decouples the data nodes from any processing. This allows to define large processing networks even outside of any device information model - namely as independent schema.

The dynamic port coupling uses a simple matching rule to couple data nodes and ports:

  1. The port type must match (Event driven or streaming)
  2. The data type of the values must match, e.g. System.Int32
  3. The port directions must be opposite. Output ports are wired to input ports.
  4. Finally, the property value of PortMatchId must match.

The dynamic port matching needs a port matching rule which is situated outside of the processing network. The rule is responsible to apply the matching rules and if successfully found any port-pairs, it couples them.

Static Port Coupling

In contrast to dynamic port coupling, the static port coupling does not need any rules for port matching.

It is often used to interconnect ports within a processing network. Here, the coupling is done by Link-nodes, a binary relation between two ports configured with the HumanOS IoT Designer.

The static port coupling needs following information:

  1. Output and Input port name
  2. Data type of the transmitted values

Data Consistency

Special attention mus be given when ever a processor must process data from multiple input ports.

One of the biggest issue is to generate consistent data, especially since each value appears on input port one after the other. The reasons are:

  • Device drivers might get the data out of different memory blocks.
  • Events or polling is done by multiple tasks. There is no fixed order of data forwarding to input ports.
  • the CPU load might affect the acquisition, delivering and processing time of each value

Processing Delays

One of the simplest technique to collect data and have a consistent processing is delaying the inputs.

Each event driven processor has a setting called DelayTime. It works as follows:

  1. First input value arrives and starts the delay timer
  2. The processing of data is delayed. In the meantime other values arrives on the inputs of the processor.
  3. After the delay time, the processor starts processing the data

The problem is to determine how long the delay time should be:

  • To long delays also the signal processing and might flatten the higher frequent value changes
  • To short delays lead to inconsistent data processing

Port Trigger Types

Another technique is to use one port as a trigger-port. That means, one of the input port is a dedicated trigger for processing where as the others are just data delivery (Trigger Type = None).

The trigger-port will be the only one which triggers the processing routine.

More information on trigger types can be found in the manual.

The problem is often to find a relevant trigger value on the device. Some examples might work, like:

  • Workpiece counter
  • Start of the program
  • Change of the operation mode

Sampling Rate

Sampled processor are not really useful for data consistency. But, they help to generate periodically snapshots of data.

In some applications, this helps to keep data consistent from a time series point of view. Where as in short term, some samples might be inconsistent, they are balanced in the long time view.

Processing only valid Data

An other issues is the fact, that values might have a bad state. This is often related to:

  • Disconnection of a device (leads to BadNotActive states)
  • Start-up behavior of HumanOS NodeSpace

Typically, a processor is needed to process "good" values. This can be achieved setting the ports to Mandatory.

If a port is marked as Mandatory the processor is triggered only if the port delivers valid data.

If the state changes to bad, all output ports are set to BadNotActive. This is very useful in complex processing networks with multiple processors in series.

Combination

Often a combination of the techniques above help to model the processing network.

In the following example D1 is the trigger which is used to trigger the processor A. Since only valid data should trigger the processor, the port is marked as Mandatory.

The other ports connected to D2 and D3 are optional.

In our example the trigger is passed further to processor B.