I am facing problems in writing a tag on OPC server.
I have two error messages in the query result window when executing the PCo Query:
These messages are also visible in the PCo log.
Please, help !
Thank you in advance.
Yes, I can browse tags using the PCo Management Console while creating or editing an alias in the Source Systems Aliases tab, as well as read tags values using the TagRetrieveQuery.
After clearing the Agent instance log, restarting the Agent instance and executing the TagStoreQuery again, I have the following log message :
Exception found while trying to process the store of item <Tag Name>
And the following log stack trace :
The given key was not present in the dictionary.
at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
at SAP.Manufacturing.Connectivity.Agents.Opc.DaGroup.Add(String name, String itemSource, Type dataType)
at SAP.Manufacturing.Connectivity.Agents.Opc.Da.OpcDaAgent.DoStore(Item item, Object value, DateTime timestamp, ItemSecondaryCollection secondaries)
One important thing I don't understand and I forgot to mention is that I can only write the tag value once but...
After writing successfully the tag value for the first time (after restarting the Agent instance), I can read it as many times as I want but I can't write it again. I need to restart the Agent instance before. And if I start reading it instead of writing it, I can't write it at all!
I hope I was clear in my answer...
Thank you, Steve, for your help.
Try this. In the Agent Instance, browse the OPC Server and add the tag you want to write as a subscription, and add a different tag for reading.. then use the PCoQuery in MII and test both a read and and a write to the tag subscribed to in the Agent Instance. This error appears to be with trying to browse for the tag address in the PLC. I would try to get this to work without the PCo Alias for now, and then setup the Alias later.
What type of PLC are you connecting to through the FactoryTalk Gateway?
Is the OPC Server running on the same server as PCo? If not, have you confirmed all your DCOM configuration?
Can you install/test using a standalone OPC Client (either FactoryTalk, or Matrikon, or Kepware Quick Client) and test tag reading/writing from the client as well?
I can't browse the OPC server through the Agent instance Subscription Items tab, I have the following browsing error message that appears in a popup:
Browsing failed; check connections and try again
[[severity = Fatal] COM Exception
[[FactoryTalk]: This error code is not a known error.]]
Also, in the Event Viewer of the system where PCo is installed, I have the following error :
DCOM was unable to communicate with the computer <Computer name> using any of the configured protocols.
About the PLC:
Type: 1756-L62 Controller ControlLogix5562
The OPC server is not running on the same server as PCo.
What do you mean by "confirming all DCOM configuration"?
I have already installed the Rockwell Automation OPCTest standalone OPC test client; reading/writing works correctly.
OPC DA Servers that run on separate OS instances than any OPC client requires that DCOM be configured on both the client and the server to allow the OPC Client to have permissiions to connect to and send/retrieve data from the server. You need to contact Rockwell and get their documentation on how to set up DCOM for non-Rockwell OPC Clients. There is also some information on setting up security here: http://help.sap.com/pco22.
There should also be an Error in the Windows Event Log that contains the COM exception error when you attempt to browse the OPC Server. Please post that error.
Also, note that the default User Account for PCo services is .\localsystem. You will have to change the User settings to a named user account that has also been granted DCOM access. Granting DCOM access to localsysem is generally considered a security risk and many customers will not permit that account to be added to DCOM.
The customer has confirmed that all DCOM settings are configured correctly, according to Rockwell recommendations.
Unfortunately, there is no log related to this COM exception in the Windows Event Viewer. The corresponding error is only notified by a popup that appears when attempting to browse the OPC server through the agent instance Subscription Items tab.
Regarding to the default user of PCo services, the customer uses a user that have administrator rights for all of them.
I was re-reading the post history and saw where you said that you WERE able to write to the tag once, and read from the tag as well. Was this from the Alias tags configuration? It appears from your posts that if the Alias configuration is not present then PCo fails when trying to browse tags. Can you post a sample of your Alias Configuration, and a sample of your Tag Write Query? I am especially interested in the full path of the Tag in both the Alias and the Tag Write.
Yes, I am able to write into the tag once, only and only if I do not read it before. No problem for reading the tag. To make writing possible again, I need to restart the agent instance.
Indeed, this was with an alias.
In the agent instance Subscription Items tab, PCo fails when trying to browse tags with or without an alias. To subscribe an item, I have to stop the agent instance first, the alias has no effect on browsing tags.
The full path (source) of the tag in the alias configuration is not the same that in the PCo query.
I assume that PCo is able to deal with this difference.
I think at this point you will need to log a CSS ticket and report the details of the browsing errors. There appear to be some discrepancies in the tag names used in browsing. Include the full version of PCo and MII, and the full version of the FactoryTalk OPC Server as well.
The problem has been solved by upgrading PCo to the most recent available version which is 2.2 SP3 and/or installing it directly on the OPC server.
I assume that it was probably due to the DCOM settings.
However, the PCoStoreQuery works now perfectly for writing tags.
Thank you again for your contribution.