Using OPC Diagnostics

What is OPC Diagnostics?

The OPC Diagnostics window provides a real-time and historical view of OPC events that occur between any OPC client and the server. OPC diagnostics logs an event which is a method call that a client makes into the server, or a callback the server makes into a client. The importance of OPC Diagnostics is that it allows Programmers and Support Technicians at Kepware to see how the customers client application is gathering data from the server. This is important when Kepware is not able to reproduce the issue that is seen on site. The rest of this document is a brief explanation of how to capture OPC Diagnostics in the server.


Setting Up OPC Diagnostics

To start you will need to open the OPC Diagnostics view by clicking on View|Diagnostics|OPC in the KEPServerEX Main Menu

By default the OPC diagnostics window will open in standby mode. To start capturing diagnostics you would select the start button in the button menu bar. You can also select Tools|Options from the Main menu and change the default behavior.

In the Options dialog you can set the OPC Diagnostics to start capturing on startup. You also choose to change whether or not you wish to change the default settings to Preserve the current diagnostics capture on your hard disk upon shutdown. Lastly, you can set the maximum number of OPC transactions to capture. The range is 1000 – 30000 transactions and the default is 5000. The number of transactions does not include the details of each transaction as they could be extensive.

In some cases you may want to limit the OPC Diagnostics capture to specific events. This can be done by selecting Diagnostics|Filter from the Main menu and then un-checking the events that you do not want.


Capturing the OPC Events

Now we will do a simple connection to the server with the OPC Quick Client to see what happens. For this example we used the Simdemo project that is provided with the server when it is installed

First you need to click the Start button in the Button Menu to start capturing diagnostics.

Next, manually start the OPC Quick Client from the 'Start Menu | Kepware Products' and selecting OPC Quick Client. Connect to the server by creating a new server connection. In the diagnostic window you can see the OPC events that are triggered.

 

Next in the OPC Quick Client add an OPC Group. Again go back to the OPC Diagnostics window and you can see the specific events that are triggered.

Once the group has been added you can then add an item to the group. You can add the item manually or browse the server for the item. As you can see by looking at the OPC Diagnostics window below, and by looking at the first event, that we had browsed the server for our tags. You will see that you get a Data Change event triggered as soon as the item is added.

Lastly, some of the details of a data change event.

When enabled, the OPC Diagnostics will capture every OPC event that has not been filtered out until it captures the specified maximum number of events.


The Complete View

If an issue arises you can capture your OPC diagnostics and send them to Kepware for troubleshooting purposes. This is done by selecting File|Save As in the Diagnostics Main Menu. You will have two options. You can save the capture in the default binary file format, which can be large but can be opened in the Diagnostics view at a later date. The other option is to save it as a text file which is much smaller and can be printed if needed.

Note: If you save the diagnostic capture as a binary file, then you can open it in the Diagnostics view and at any time, and then you can save and copy as a text file for printing. However, if you save it as a text file you cannot open it back up in the Diagnostics view.


Sample OPC Diagnostics Text File


3/19/2004 17:40:46 IConnectionPointContainer::FindConnectionPoint (Server)
0000000016: Event started
0000000016: InterfacePointer = 0x053054F0
0000000016: [in] REFIID = IID_IOPCShutdown
0000000016: Function succeeded. Result = 0x00000000
0000000016: [out] ConnectionPoint = IID_IOPCShutdown
0000000016: Event complete
3/19/2004 17:40:46 IConnectionPoint::Advise (Server)
0000000000: Event started
0000000000: InterfacePointer = 0x05302688
0000000000: Establishing client callback.
0000000000: Function succeeded. Result = 0x00000000
0000000000: [out] Cookie = 0x05302688
0000000000: Event complete
3/19/2004 17:41:49 IOPCServer::AddGroup ()
0000000016: Event started
0000000016: InterfacePointer = 0x05304F20
0000000016: [in] Name = OPC_Diag_Test

KEPServerEX Features Page »»