logo-opclabs-new

Professional OPC Development Tools and Services

opc logo

StreamInsight Option for QuickOPC

The StreamInsight Option for QuickOPC allows you to bring in streaming data from OPC sources into StreamInsight, analyze them and process them further, and even feed the results back to OPC servers. With OPC StreamInsight, data from OPC can be combined with data from multiple other sources. You can monitor the data for meaningful patterns, trends and exceptions. Streaming OPC data can be analyzed and correlated while they are in-flight.

Microsoft StreamInsight is a platform for writing and running complex event processing (CEP) applications. Such application can e.g.:

  • Acquire events from multiple data streams, process them, search for correlations, and pinpoint important conditions in the monitored processes.
  • Provide centralized means for processing of high volume, real-time data.
  • Make complex analysis of the data in the time domain.
  • Aggregate data streams originating in different sources.
  • Gain continuous operations performance insight.

OPC/StreamInsight Features

The StreamInsight Option for QuickOPC supports connections to OPC servers with following specifications:3D box - StreamInsight Option - transparent

  • OPC Data Access
  • OPC Alarms and Events
  • OPC Unified Architecture (data access)

The StreamInsight option is a license type for QuickOPC, while technically it is contained in the same installation package. The StreamInsight support in QuickOPC is not separate from its other parts. Instead, the OPC streaming data layer builds on top of many features and components already available in QuickOPC. Specifically, the StreamInsight Option makes ideal usage of the connection-less approach in QuickOPC, and the reactive programming model (OPC Reactive Extensions, Rx/OPC). This means that you can also easily combine the StreamInsight development with all other options and features provided by QuickOPC.

For more information:

StreamInsight Option for QuickOPC User's Guide (PDF)

StreamInsight Code Example

The code snippet below will define and deploy a StreamInsight input source. In this example, the data is a simple temporal stream of point events generated by an OPC Data Access server.

    // DEFINE a simple SOURCE (returns a point event every second)
    const string machineName = "";
    const string serverClass = "OPCLabs.KitServer.2";
    const string itemId = "Simulation.Incrementing (1 s)";
    var observable = DAItemChangedObservable.Create<int>(machineName, serverClass, itemId, 100);
    var mySource = myApp
        .DefineObservable(() => observable)
        .ToPointStreamable(
            eventArgs => 
                PointEvent.CreateInsert(DateTimeOffset.Now, 
                (DAItemChangedPayload<int>)eventArgs),
            AdvanceTimeSettings.StrictlyIncreasingStartTime);

Next, we will compose a query over the input source. The query uses LINQ as the query specification language. In this example, the query returns the events where the value of the OPC item is an even number.

    // Compose a QUERY over the source (return every event carrying even data value)
    var myQuery = from e in mySource
                  where e.VtqPayload.Value % 2 == 0
                  select e;

Technically, this definition translates to a filter operator that drops all events from the sequence that do not fulfill the filter predicate (where e.VtqPayload.Value % 2 == 0) and returns the event value.