Professional OPC
Development Tools

logos

OPCLabs for dummies?

More
09 Feb 2018 06:29 #6009 by support
Replied by support on topic OPCLabs for dummies?
You are welcome. I am glad it works :-)

Be not afraid to ask more questions. It is a useful feedback for us, too, to learn about where are the common stumbling blocks.

Best regards
Z.

Please Log in or Create an account to join the conversation.

More
08 Feb 2018 18:48 #6007 by andrew.w.toole
Replied by andrew.w.toole on topic OPCLabs for dummies?
Hey Zbynek,

Over the past couple days I've been messing around with implementing OPC UA in my application. It's awesome! I've got it reading and writing values to the PLC via the KEPServerEX interface. Thanks so much for your help my friend. I really appreciate you taking the time to help out a noob like myself :)

I'm going to recommend to the project stakeholders that we purchase a licence for OPCLabs.

Thanks again man. I'm sure I will have more questions for you before too long.

Please Log in or Create an account to join the conversation.

More
06 Feb 2018 05:28 - 06 Feb 2018 05:29 #5964 by support
Replied by support on topic OPCLabs for dummies?
If BrowseNodes does not throw an exception, the UAEndpointDescriptor is correct for sure.

What is likely incorrect is the UANodeDescriptor.

I suggest that you
- use BrowseDataNodes instead (that will save you from having to specify browse parameters which is not that easy), and
- start browsing from the "Objects" node, which is what you get when you pass UAObjectIds.ObjectsFolder (in OpcLabs.EasyOpc.UA.AddressSpace.Standard namespace) in place of the node descriptor.

Best regards
Last edit: 06 Feb 2018 05:29 by support.

Please Log in or Create an account to join the conversation.

More
05 Feb 2018 21:48 #5963 by andrew.w.toole
Replied by andrew.w.toole on topic OPCLabs for dummies?
....I'm confused......so if I have, say in KepServerEx, I have a channel "My Channel" and a Device "My Device" and then tags in that, and the server is local, then if I want to get a list of nodes off of my Global tag at MyChannel.MyDevice.Global, I would use:

var nodes=EasyUAClient.BrowseNodes(
new UAEndpointDescriptor("opc.tcp://127.0.0.1:49320/"),
new UANodeDescriptor("MyChannel.MyDevice.Global"),
null
)

Is that right? When I do this I get UAApplicationElementCollection nodes of length 0. So that can't be right. Although it is connecting properly because I got the accept certificate popup and have added IIS Worker Process to KepServerEX's trusted clients.

So I guess maybe the UAEndpointDescriptor part might be correct?

Not sure exactly just because I don't know how exactly I would point to the right node to start browsing in terms of its namespace.

Please Log in or Create an account to join the conversation.

More
05 Feb 2018 20:10 #5961 by support
Replied by support on topic OPCLabs for dummies?
The first parameter is the target OPC UA server (endpoint URL).

The second parameter, though it may look like URL, is a Node ID - an equivalent of Item ID in OPC Classic. In OPC UA, it differs in two main things:
- it contains a namespace qualification - that's the "nsu=" part
- it may be a string (like Item ID in OPC Classic), or an integer, or a GUID, or opaque (byte array).

You best bet is to figure out the Node Id is by browsing, again. Interactively, you can use e.g. the Connectivity Explorer in QuickOPC, to connect to the Kepware Server and see which node IDs it has.

Typical OPC UA gotchas:
- I think OPC UA is by default disabled in KepServer - you need to explicitly enable it.
- Make sure the firewall does not block the port used for communication on either the server or client side.
- When secure communication is used, server uses a certificate provide by the client to authenticate the client. QuickOPC will generate its own certificate and KepServer will initially reject it. But you will find it in the OPC UA configuration of KepServer, and "trust" it - and it will work then.
- Conversely, client needs to tust the server certificate when secure comm. is used. More on that later if that becomes an issue.

I suggest you first try the Connectivity Explorer. That's easier than writing the code. When any issues are resolved, coding should not be such a big deal. The Connectivity Explorer will also help you in determining what the Node IDs are etc.

Regards

Please Log in or Create an account to join the conversation.

More
05 Feb 2018 19:56 #5960 by andrew.w.toole
Replied by andrew.w.toole on topic OPCLabs for dummies?
OK, this looks fairly straight forward. I'm a little confused about the parameters though. They use 2 url's.......How would I provide parameters to the following code in my application?


object value = easyUAClient.ReadValue(
" opcua.demo-this.com:51211/UA/SampleServer ",
"nsu=http://test.org/UA/Data/;i=10853");

Please Log in or Create an account to join the conversation.

More
05 Feb 2018 19:34 #5959 by support
Replied by support on topic OPCLabs for dummies?
Assuming that you want to do roughly the same as you do now with OPC DA, then:

Browsing for nodes: opclabs.doc-that.com/files/onlinedocs/QuickOpc/Latest/User%2...%20for%20OPC%20UA%20Nodes.html

Reading values: opclabs.doc-that.com/files/onlinedocs/QuickOpc/Latest/User%2...ing%20just%20the%20value2.html

Best regards

Please Log in or Create an account to join the conversation.

More
05 Feb 2018 19:32 #5958 by andrew.w.toole
Replied by andrew.w.toole on topic OPCLabs for dummies?
I'd like to take a look at UA. Can you recommend any good sample code I can try as an example?

Please Log in or Create an account to join the conversation.

More
05 Feb 2018 19:24 - 05 Feb 2018 19:25 #5957 by support
Replied by support on topic OPCLabs for dummies?
The error that's in the log (0x800706ba) is "The RPC server is unavailable.". So that's a good thing - it's now clear that all clients behave the same - resolving it for one would resolve them all.

The behavior you described with stopping the runtime is somewhat weird but I cannot reliably comment on it, since I do not have that much experience operating KepServerEX. I would also note that clients often have auto-reconnect capabilities, in which case if you stop the server, it can get started later again.

Here are your options as I see that:

a) Make sure everything is installed correctly on the OPC server side. If you run the OPC Quick Client directly there, does it work well? Things like OPC proxies/stubs might be corrupted - reinstall of the server, or of OPC Core Components ( opcfoundation.org/developer-tools/developer-kits-classic/core-components/ ) would probably help in such case.

b) Contact Kepware support. You might be pleasantly surprised - AFAIK, these guys are quite responsive.

c) Do as (b), but with even more data in hand. That would involve collecting the OPC communication logs using so-called OPC Analyzer. It's a bit more work, but not really that much. See articles in our Knowledge Base:
kb.opclabs.com/How_to_use_OPC_Analyzer and
kb.opclabs.com/Collecting_information_for_troubleshooting

d) Give up on OPC Classic, switch to OPC Unified Architecture (OPC UA). This is a newer set of OPC specs that does not rely on Microsoft COM. KepServerEX supports it, and our QuickOPC supports it as well. You certainly won't get the problem you are getting now, with OPC UA - but that's not to say it's without problems of its own.

Best regards
Last edit: 05 Feb 2018 19:25 by support.

Please Log in or Create an account to join the conversation.

Moderators: support
Time to create page: 0.221 seconds

      

 Recommend this on Google