Troubleshooting OPC and DCOM
Troubleshooting OPC and DCOM
After identifying the specific problem you are having, this whitepaper describes their typical causes, and the required steps to solve them.
Page 2 of 8
To check the Startup Type for OpcEnum follow the steps below: Click Start, and then click Control Panel. Click Performance and Maintenance, click Administrative Tools, and then double-click Computer Management. The Computer Management window for the local computer is displayed. "Computer Management (Local)" is displayed at the root of the console tree. In the console tree, expand Services and Applications, and click on the Services container. Look for OpcEnum in the right-hand window pane. If the Startup Type is set to Disabled, then OpcEnum is indeed disabled and you will have to enable it (below). If Image 1: The Services panel indicates that the OpcEnum services is Disabled. OpcEnum is not on the list, then it has likely not been installed, so you should go back to step 1.1 OpcEnum is not installed. If the Startup Type for OpcEnum is already set to either Manual or Automatic, then skip to step 1.3 Anonymous Logon access not given. To enable OpcEnum, right click on OpcEnum, and select the Properties option. In the Startup Type Combo Box, select Manual. While it is also possible to select the Automatic setting, I recommend that you select Manual so that OpcEnum will only execute when required.
Now that the Startup Type for OpcEnum is properly set, try to browse the remote computer again. If it still doesnt work, move to the next step.
Page 3 of 8
Image 3: Turn off "Simple File Sharing" to enable Windows to Authenticate User Accounts properly.
After authenticating an incoming User Account, the Operating System then checks whether or not the User Account is allowed to Launch and/or Access the OPC Server. This is done with the use of an Access Control List (ACL). The ACL for each application includes information on the User Accounts that are permitted or denied from taking specific actions. Thus, it is possible that the Operating System will deny access either because the ACL does not include the necessary permissions for a User Account, or because that User Account is explicitly denied from receiving launch/access rights. If either of these is the case, you must change the ACL for the OPC Server. To learn more about how the ACL affects OPC Servers and how to set it properly, refer to my whitepaper titled OPC and DCOM: 5 things you need to know. Specifically, look for section 3.3 COM Security.
Page 4 of 8
Interactive User: The OPC Server Identity is set to Interactive User but there is no Interactive User. In this case, the Operating System will be unable to launch the OPC Server because no one is logged in the computer. If this setting is actually correct, you must ensure that someone is logged in to Windows. Launching User: The OPC Server Identity is set to Launching user and someone is already connected to the OPC Server. If your server only supports a single instance at a time, and someone is already connected to the OPC Server, then the second person will be unable to establish a connection. Once the first person disconnects, the second person will be able to connect. If this setting is actually correct, you must ensure that no one is connected to the OPC Server. This User: The OPC Server Identity is set to This user and the specific User Account was deleted after setup. In this case, the OPC Server will fail to launch because the User Account under which it must execute is no longer valid. If this setting is desirable, then you must ensure that the OPC Server uses a valid User Account.
Image 4: Use the Identity Tab to set the OPC Server's identity. Typically, OPC Server Identity should be set to "The system account (services only)".
In general, I do not recommend any of the settings above due to the problems that they cause. Instead, I recommend that you use The system account (services only) setting, unless your OPC vendor specifies otherwise.
Page 5 of 8
4.1 Firewall
If the OPC Client PC is behind a (hardware or software) firewall, callbacks may fail to arrive at their destination. While the OPC Client will be able to make outgoing OPC calls, callbacks from the OPC Server may be blocked by the firewall. To learn more about the Windows Firewall and how to disable it, refer to my whitepaper titled OPC and DCOM: 5 things you need to know. Specifically, look for section 1. Remove Windows Security.
Page 6 of 8
In general, I recommend that you use The system account (services only) setting, unless your OPC vendor specifies otherwise.
OPC Client issues device reads: In this case, the OPC Client is constantly asking the OPC Server to bypass its own built-in data exchange optimization and retrieve values directly from the device/PLC. This can slow the OPC Server down significantly. If this is the case, check into changing all reading calls to Cache instead of Device reads. OPC Client issues asynchronous reads: In this case, you should suspect that the OPC Server is not properly optimized and the cause likely has nothing to do with OPC communication. Instead, you should suspect the communication between the OPC Server and its data source. This deserves a call to the OPC Server vendor. Let them know about your concern, and ask them for help in optimizing your communication.
6. Conclusion
OPC is powerful industrial communication standard. However, OPC relies on having DCOM work properly. Luckily, DCOM problems can usually be overcome with relatively simple configuration changes as documented in this whitepaper. To get a deeper understanding of OPC, DCOM, and the diagnosis of all common problems OPCTI highly recommends that you take time to get formal OPC training. This will enable you to structure your OPC knowledge to help you reduce your short and long-term project costs. OPCTI also encourages you to provide us with feedback. Let us know about new problems and solutions that you found. We will pass these on to the rest of the OPC community, to help everyone get connected.
About the author: Randy Kondor is a Computer Engineer, and is the President of the OPC Training Institute, the worlds largest OPC Training company. Since 1996, Randy has been vastly involved within the OPC industry and a strong supporter of the OPC Foundation. He continues to dedicate himself to spreading the OPC Foundation's message about system interoperability and inter-vendor cooperation. Contact information: Email: [email protected] Phone: +1-780-784-4444 Fax: +1-780-784-4445
Copyright 2008 OPC Training Institute (OPCTI). All rights reserved. The information contained in this document is proprietary to OPCTI. No part of this document may be reproduced, stored in a retrieval system, translated, or transmitted in any form or by any means, electronic, mechanical, photocopying, recording, or otherwise, without prior written permission from OPCTI. OPC Training Institute 16420 89 Avenue Edmonton, Alberta Canada T5R 4R9 T 1-780-784-4444 F 1-780-784-4445 [email protected] www.opcti.com
Page 8 of 8