Help with OPC UA Client|OPC UA Standard|Forum|OPC Foundation

Avatar
Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
Lost password?
sp_Feed sp_PrintTopic sp_TopicIcon
Help with OPC UA Client
Avatar
Harala Muvak
Member
Members
Forum Posts: 7
Member Since:
12/10/2019
sp_UserOfflineSmall Offline
1
12/10/2019 - 19:55
sp_Permalink sp_Print

Hi everyone,

I’m starting a project about OPC UA. My requirement is: writing C# to create an app to take data from a PLC (or at least a PLC simulator such as Siemens PLCSIM Advance), then send it to the server/cloud. 

While I haven’t had any ideas about the project, I tried the one in this link: https://github.com/OPCFoundati…..releases 

The problems are:

 1) I tried to use kepware to create a server connecting with C# client, but the Authentication Mode always requires UserName and Password. I watched an instruction video in Youtube and they had another option for Anonymous but I cannot find it.

 2) For my requirement, I believe there is a more simple way to execute my project. I mean the sample project above is to detailed which contain both OPC UA Server and Client. So please instruct me if possible 🙁

Thank you so much for reading and hope to get some help from you. 

Avatar
Randy Armstrong
Admin
Forum Posts: 1579
Member Since:
05/30/2017
sp_UserOnlineSmall Online
2
12/11/2019 - 07:20
sp_Permalink sp_Print

KepServer has a UA configuration panel (right click on the tray icon)..

This should allow you to configure anonymous users.

Even if you cannot it is simple to pass a username UserIdentity with the .NET codebase.

Note that it would take me about 10min to create a demo with the C# client codebase and KepServer so you are on the right track. It is just the learning curve that your are struggling with.

Avatar
Harala Muvak
Member
Members
Forum Posts: 7
Member Since:
12/10/2019
sp_UserOfflineSmall Offline
3
12/23/2019 - 20:47
sp_Permalink sp_Print

Randy Armstrong said
KepServer has a UA configuration panel (right click on the tray icon)..

This should allow you to configure anonymous users.

Even if you cannot it is simple to pass a username UserIdentity with the .NET codebase.

Note that it would take me about 10min to create a demo with the C# client codebase and KepServer so you are on the right track. It is just the learning curve that your are struggling with.

  

Hi Randy Armstrong, 

Sorry for not replying for so long due to my personal issues,

Back to my question, I heard that writing an OPC UA Client is much easier than writing Server, however I’m new to this so there are some confusion to me. Should I use some library like the sample project does? And should I rewrite a new one based the sample one?

Also, for the Kepware setting, did you instruct me to open windows like the attached photo? I changed the security policies but the Anonymous users didn’t appear.

Thank you for helping and hope to see your reply.

Avatar
Randy Armstrong
Admin
Forum Posts: 1579
Member Since:
05/30/2017
sp_UserOnlineSmall Online
4
12/24/2019 - 01:35
sp_Permalink sp_Print

This console client should connect to the KepServer if you give it the proper URL:
https://github.com/OPCFoundati…..Program.cs

Avatar
Harala Muvak
Member
Members
Forum Posts: 7
Member Since:
12/10/2019
sp_UserOfflineSmall Offline
5
01/05/2020 - 19:34
sp_Permalink sp_Print

Randy Armstrong said
This console client should connect to the KepServer if you give it the proper URL:

https://github.com/OPCFoundati…..Program.cs

  

Hi Randy Armstrong,

Sorry for not answering again.

And thank you very much for the sample program above, it’s much easier for me to carry out my project now.

Moreover, I got another question. It’s quite ridiculous, I think, but I don’t really understand about how the system work.

  1. I have done a project: using Citect SCADA as SCADA software, 2 laptops as Server and Client, and using Kepware to config an OPC UA connection between them. Then I got a PLC, connect it to the PLC Server laptop, so that the Server read and write data from and to PLC. And because of the OPC UA connection, the client laptop can display data, and also send some control signal to PLC.
  2. In the one I asked above, the problem is that: the client writen by C# has to read data from PLC, then send it to Cloud.

So as I understand, the roles of Server and Client in those 2 projects are reversed, right? I mean in project 1, Server connects directly to PLC, why Client access data through Server. And in project 2, Client connects to PLC, then send data to Server.

And if so, is there any difference in the configuration? For example, in project 1, I connect the PLC to Client, are there any changes I need to make it work?

I think there’s a lot of instructions in the internet, but my English is not really good so it’s quite hard for me to scan all those document for the answer. So hope to see your help or some reference from you again. 

Thank you so much

Avatar
Randy Armstrong
Admin
Forum Posts: 1579
Member Since:
05/30/2017
sp_UserOnlineSmall Online
6
01/05/2020 - 21:30
sp_Permalink sp_Print sp_EditHistory

Is the PLC running a UA server?

If yes then KepServer is an unnecessary middleman and the code used to connect to KepServer should work to connect to the PLC.

If the PLC is using another protocol then you need to write code that understands that protocol which would duplicate features that KepServer already has.

Avatar
Harala Muvak
Member
Members
Forum Posts: 7
Member Since:
12/10/2019
sp_UserOfflineSmall Offline
7
01/07/2020 - 20:21
sp_Permalink sp_Print

Ok I get it. Thank you for helping me since first day.

Forum Timezone: America/Phoenix
Most Users Ever Online: 510
Currently Online: Randy Armstrong
Guest(s) 57
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Forum Stats:
Groups: 2
Forums: 10
Topics: 1445
Posts: 4889