StreamInsight Extensions for QuickOPC: Difference between revisions

From OPC Labs Knowledge Base
(Created page with "Category:StreamInsight <div class="content-intro"> <h1 title="Develop OPC StreamInsight solutions">StreamInsight Extensions for QuickOPC</h1> <p>The StreamInsight Extensions for QuickOPC> allow you to bring in <i>streaming data</i> 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 monit...")
 
No edit summary
 
Line 21: Line 21:
<li>OPC Unified Architecture (data access)</li>
<li>OPC Unified Architecture (data access)</li>
</ul>
</ul>
<p>The StreamInsight support in <a href="index.php?Itemid=1086">QuickOPC</a> is not separate from its other parts. Instead,&nbsp;the OPC streaming data&nbsp;layer builds on top of many features and components already available in <a href="index.php?Itemid=1086">QuickOPC</a>. Specifically, the StreamInsight Extensions&nbsp;make ideal usage of the connection-less approach in <a href="index.php?Itemid=1086">QuickOPC</a>, and the reactive programming model (<a href="index.php?Itemid=1183">OPC Reactive Extensions, Rx/OPC</a>). This means that you can also easily combine the StreamInsight development with all other features and extensions provided by <a href="index.php?Itemid=1086">QuickOPC</a>.</p>
<p>The StreamInsight support in QuickOPC is not separate from its other parts. Instead,&nbsp;the OPC streaming data&nbsp;layer builds on top of many features and components already available in QuickOPC. Specifically, the StreamInsight Extensions&nbsp;make 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 features and extensions provided by QuickOPC.</p>
<p>For more information:</p>
<p>For more information:</p>
<p class="attention">[https://www.doc-that.com/files/onlinedocs/OPCLabs-ConnectivityStudio/Latest/User%27s%20Guide%20and%20Reference-Connectivity%20Software/webframe.html#StreamInsight%20Extensions.html StreamInsight Extensions (in QuickOPC User's Guide)&nbsp;(online)]</p>
<p class="attention">[https://www.doc-that.com/files/onlinedocs/OPCLabs-ConnectivityStudio/Latest/User%27s%20Guide%20and%20Reference-Connectivity%20Software/webframe.html#StreamInsight%20Extensions.html StreamInsight Extensions (in QuickOPC User's Guide)&nbsp;(online)]</p>
Line 27: Line 27:
<div class="content-1block">
<div class="content-1block">
<h2>StreamInsight Code Example</h2>
<h2>StreamInsight Code Example</h2>
<div style="float: right;"><a href="index.php?option=com_content&amp;view=category&amp;layout=blog&amp;id=44&amp;Itemid=112" class="readon"><span>Try It</span></a></div>
<p>The code snippet below will define and deploy a StreamInsight&nbsp;input source. In this example, the data is a simple temporal stream of point events generated by&nbsp;an OPC Data Access server.</p>
<p>The code snippet below will define and deploy a StreamInsight&nbsp;input source. In this example, the data is a simple temporal stream of point events generated by&nbsp;an OPC Data Access server.</p>



Latest revision as of 15:51, 12 December 2025

StreamInsight Extensions for QuickOPC

The StreamInsight Extensions for QuickOPC> allow 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 Extensions for QuickOPC support connections to OPC servers with following specifications:

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

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 Extensions make 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 features and extensions provided by QuickOPC.

For more information:

StreamInsight Extensions (in QuickOPC User's Guide) (online)

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.

Useful links: Documentation / Examples