Your UA obbservable example (below) only produces one sample. - surely it should produce a constant stream? The opc node is definitely changing constantly on the server...
// $Header: $
// Copyright (c) CODE Consulting and Development, s.r.o., Plzen. All rights reserved.
// ReSharper disable CheckNamespace
// ReSharper disable PossibleNullReferenceException
#region Example
// Shows how to create an observable for OPC-UA monitored item changes, and subscribe to it.
using OpcLabs.EasyOpc.UA.Reactive;
using System;
using System.Threading;
namespace ReactiveDocExamples
{
namespace _UAMonitoredItemChangedObservable
{
class Subscribe
{
public static void Main()
{
Console.WriteLine("Creating observable...");
UAMonitoredItemChangedObservable<float> dynamic =
UAMonitoredItemChangedObservable.Create<float>(
"opc.tcp://localhost:51210/UA/SampleServer", "nsu=http://test.org/UA/Data/;i=10853", 1000);
Console.WriteLine("Subscribing...");
using (dynamic.Subscribe(e => Console.WriteLine(
e.Exception == null ? e.AttributeData.ToString() : e.Exception.GetBaseException().ToString())))
{
Console.WriteLine("Waiting for 10 seconds...");
Thread.Sleep(10*1000);
Console.WriteLine("Unsubscribing...");
}
}
}
}
}
#endregion
// ReSharper restore PossibleNullReferenceException
// ReSharper restore CheckNamespace
and the output =
0) Return
1) "ReactiveDocExamples._DAItemChangedObservable.Subscribe.Main"
2) "ReactiveDocExamples._DAWriteItemValueObserver.OnNext.Main"
3) "ReactiveDocExamples._DAReactive.Composition.Pipeline"
4) "ReactiveDocExamples._UAMonitoredItemChangedObservable.Subscribe.Main"
5) "ReactiveDocExamples._UAReactive.Composition.Pipeline"
6) "ReactiveDocExamples._UAWriteValueObserver.OnNext.Main"
Select action to perform <0>? 4
Creating observable...
Subscribing...
Waiting for 10 seconds...
-2.361808E-31 {System.Single} @30/07/2014 18:25:56 @@30/07/2014 18:25:56; Good
Unsubscribing...
Press Enter to continue...