View Issue Details

IDProjectCategoryView StatusLast Update
0003479COM-AE Sample CodeUsabilitypublic2016-07-29 05:18
Reporterzhang yuanyuan Assigned To 
PriorityimmediateSeverityblockReproducibilityalways
Status newResolutionopen 
PlatformC#OSWindows Server OS Version2012 R2 X64
Summary0003479: After work a period time, AE Service automatic does not recevice data from OPC Server
Description

This attachment is my tool. It is used OPC NET API AE and it is very simple. Connect OPC Server, receive alarm and save into CSV file. the source code is almost same as OPC Foundation sample code which is downloaded about year 2013.
If you need source code, please tell me. I will send it to you.

After work a period time, AE Service automatic does not recevice data from OPC Server.But OPC connection and subscript status both are normal.

I hope you can help me and give me some suggestion. Thanks again. And wait your reply.

Steps To Reproduce

I setup this tool and connect OPC Server successful and start to receive alarms. After work a period time, tool stop to receive alarm. But OPC Server and DCS both work fine. After restart this tool, it can receive alarms.

  1. After connect OPC Server successful, one method will check OPC connection status and Event Subscript status very 1 minute, both all normal. But cannot receive alarm.

  2. And then I add one function that if this tool does not receive alarm more than 10 minutes, it will automatic reconnect OPC Server. After run this function, reconnect OPC Server successful , but create subscript event failed. The error is DCOM error. Please see below.
    2016-07-18,00:00:11,WARNING,Setup OPC Server Connection,-----------Trying to setup OPC Server connection.------------
    2016-07-18,00:00:11,INFORMATION,OPCConnectionMonitor,Not receving alarms for long time, Auto Restarting OPC Connection: 10.130.36.37
    2016-07-18,00:00:18,INFORMATION,AeController.SetupOPCServerConnection(),opcae://10.130.36.37/Yokogawa.ExaopcAECS1.1 connected.
    2016-07-18,00:00:19,INFORMATION,AeController.PrintSubscriptionInfo(),BufferTime :0
    2016-07-18,00:00:19,INFORMATION,AeController.PrintSubscriptionInfo(),MaxSize :1000
    2016-07-18,00:00:19,INFORMATION,AeController.PrintSubscriptionInfo(),KeepAlive :10
    2016-07-18,00:00:19,INFORMATION,AeController.PrintInformation(),Print information successfully.
    2016-07-18,00:00:27,INFORMATION,OpcEvtHandler.GetReadyToReceiveEvts(),ready to register event change handler. Register EvtHandler failed, Error: System.Runtime.InteropServices.COMException (0x80010111): OLE received a packet with an invalid header. (Exception from HRESULT: 0x80010111)
    at OpcRcw.Comn.IConnectionPoint.Advise(Object pUnkSink, Int32& pdwCookie)
    at OpcCom.ConnectionPoint.Advise(Object callback)
    at OpcCom.Ae.Subscription.Advise()
    at OpcCom.Ae.Subscription.add_EventChanged(EventChangedEventHandler value)
    at Opc.Ae.Subscription.add_EventChanged(EventChangedEventHandler value)
    at OpcEvtHandler.RegisterNewEvtHandler(String& msg).

  3. I do one more testing the function that AE Collector tool reconnect OPC Server after does not receive alarm more than 10 minutes.
    It is successful. It does not have DCOM error.
    (1). Setup AE Collector tool and connect OPC Server. And then it starts to receive alarms.
    (2). Stop DCS test function, so DCS does not general alarm and AE Collector tool also cannot receive alarms. And then check the log file
    2016-07-20,17:36:31,INFORMATION,OPCConnectionMonitor,Not receving alarms for long time, Auto Restarting OPC Connection: 192.168.6.10
    2016-07-20,17:36:34,INFORMATION,AeController.SetupOPCServerConnection(),opcae://192.168.6.10/Yokogawa.ExaopcAECS1.1 connected.
    2016-07-20,17:36:34,INFORMATION,AeController.PrintSubscriptionInfo(),BufferTime :0
    2016-07-20,17:36:34,INFORMATION,AeController.PrintSubscriptionInfo(),MaxSize :1000
    2016-07-20,17:36:34,INFORMATION,AeController.PrintSubscriptionInfo(),KeepAlive :10
    2016-07-20,17:36:34,INFORMATION,AeController.PrintInformation(),Print information successfully.
    2016-07-20,17:36:34,INFORMATION,OpcEvtHandler.Connect(),Staring browsing areas.
    2016-07-20,17:36:34,INFORMATION,OpcEvtHandler.GetReadyToReceiveEvts(),ready to register event change handlerfinish register event change handler
    2016-07-20,17:36:34,INFORMATION,AeController.SetupOPCServerConnection(),opcae://192.168.6.10/Yokogawa.ExaopcAECS1.1 finished subscription.
    (3). Start DCS test Function again, AE Collector tool can automatic receive alarms.

Based on point 3, the reconnect OPC function is working. Source code does not have problem.

So now problem is

  1. Why this tool stop receive alarm from OPC Server.
  2. About reconnect OPC Server function, why the DCOM error happen?
Additional Information

I want to know that it is my source code problem. or environment problem. I check the my server DCOM configuration on OPC Server DCOM configuration, all are normal.

TagsNo tags attached.
Attached Files
AECollectionTool.rar (323,502 bytes)

Activities

Issue History

Date Modified Username Field Change
2016-07-25 09:25 zhang yuanyuan New Issue
2016-07-25 09:25 zhang yuanyuan File Added: AECollectionTool.rar