vegard

Accessing data via AFSDK using PIDataPipe results in Error given enough time

Discussion created by vegard on Feb 26, 2013
Latest reply on Feb 27, 2013 by RJKSolutions

Using the AFSDK (v4.0.0.0), we are attempting to stream data from our PI Server over WCF using PIDataPipe. The stream is sent in intervals of 1Hz to 10Hz (which we recalculate to intervals in milliseconds).

 

We are using WCF's callback technology, which lets the client expose an object to which the WCF service sends PIPoint values (ref. http://msdn.microsoft.com/en-us/magazine/cc163537.aspx).

 

More specifically, we create a PIDataPipe which is filled with PIPoints (approximately 20 during our initial test). Following, we call the PIDataPipe method GetUpdatedEvents() - and then forward that array to the client's callback object. This appears to work fine for a while (this time period varies), before our test client OR our test server (we haven't been able to pinpoint this yet) receives an exception and the data stream stops. The exception appears to be thrown from the PI server with the following exception message: ": [-10733] PINET: RPC Resolver is Off-Line.".

 

When we check the logs of the PI server we are accessing data on, we see A LOT of the following events in the PI message log:

 

E 26-Feb-13 00:22:03 pitotal (12080) >> Update Manager error: [-10733] PINET: RPC Resolver is Off-Line.
C 26-Feb-13 00:22:11 pibasess:MDBAF Sync (17028) >> Failed to read MDB Events from update queue. Will Retry.. Error: [-10733] PINET: RPC Resolver is Off-Line.. Unable to get MDB change records: [-10733] PINET: RPC Resolver is Off-Line.
I 26-Feb-13 00:22:12 pinetmgr (7121) >> Deleting connection:  piupdmgr(9208), Asynch read failed. [109] The pipe has been ended., ID: 14   :0
E 26-Feb-13 00:22:31 pialarm  (13063) >> Update Manager error: [-10733] PINET: RPC Resolver is Off-Line.
E 26-Feb-13 00:23:02 pisnapss (6050) >> Send Update failed, size: 650172 Status: [-10722] PINET: Timeout on PI RPC or System Call.
E 26-Feb-13 00:23:02 pisnapss (6050) >> Send Update failed, size: 650172 Status: [-10722] PINET: Timeout on PI RPC or System Call. - Abandoned.
E 26-Feb-13 00:23:06 pisnapss (6050) >> Send Update failed, size: 50416 Status: [-10733] PINET: RPC Resolver is Off-Line. - Abandoned.
E 26-Feb-13 00:23:11 pisnapss  (6050) >> Send Update failed, size: 50440 Status: [-10733] PINET: RPC Resolver is Off-Line. - Abandoned.

... (error messages are repeated every 4 seconds)

E 26-Feb-13 05:46:13 pisnapss >> Send Update failed, size: 50190 Status: [-10733] PINET: RPC Resolver is Off-Line. - Abandoned.
E 26-Feb-13 05:46:18 pisnapss >> Send Update failed, size: 50052 Status: [-10733] PINET: RPC Resolver is Off-Line. - Abandoned.
E 26-Feb-13 05:46:19 pibasess >> Send Update failed, size: 0 Status: [-10733] PINET: RPC Resolver is Off-Line.
E 26-Feb-13 05:46:23 pisnapss >> Send Update failed, size: 50168 Status: [-10733] PINET: RPC Resolver is Off-Line. - Abandoned.
E 26-Feb-13 05:46:27 pisnapss >> Send Update failed, size: 50252 Status: [-10733] PINET: RPC Resolver is Off-Line. - Abandoned.

 

This error message continues approximately every 4 seconds until we restart the PI server using pisrvstop and pisrvstart. After that, we can start our client again (until it crashes).

 

Here are some code samples from our application: 

 
PIServer piServer = new PIServers().DefaultPIServer;
piServer.Connect();
// piTags is a List of pipoint names
List piPoints = PIPoint.FindPIPoints(piServer, piTags, null).ToList();
PIDataPipe piPipe = new PIDataPipe(AFDataPipeType.Snapshot);
piPipe.AddSignups(piPoints);
// resolution is 100 ms using System.Threading.Timer
_callbackTimer = new Timer(TimerCallback, null, 0, resolution);
// PITag is an internal class
// _tags.Count is the number of PIPoints in the piPipe
private void TimerCallback(object sender)
{
  var valuepitags = _pipe.GetUpdateEvents(_tags.Count).Select(p => new PITag {
    Id = p.Value.PIPoint.Name,
    Value = p.Value.Value,
    TimeStamp = p.Value.Timestamp
  }).ToArray();
  callback.StreamSignal(valuetags);
} 

 

 

Do you have any suggestions what may be causing this? Should we have used a different approach in our code when accessing the PI Server?

Outcomes