Forum Home › Forums › Development and Integration › Source Code KpOpc.dll
Tagged: opc da
- This topic has 50 replies, 5 voices, and was last updated 5 years, 4 months ago by SuperDev.
-
AuthorPosts
-
March 29, 2018 at 6:41 pm #3392MikhailModerator
Why don’t associate directly Tag path (ex: Group1.group2.item1.item2.Int8) with an unique identifier for web server ?
Currently, tags are bound to input channels by the Signal field. To allow binding by tag name, the configuration database have to be modified.
DLL is called with MTA Thread mode, and it would be on STA.
As I understand, OPC UA doesn’t use COM objects, so thread mode is not a problem here. Is it true or not?
to understand which function are called by KP when it’s try to load DLLs
Do you know how to debug DLLs and set breakpoints? If not, I will give you a clue. It will help to understand. Also use WriteToLog method.
April 3, 2018 at 7:34 am #3414syndrome5ParticipantAs I understand, OPC UA doesn’t use COM objects, so thread mode is not a problem here. Is it true or not?
I got the following error : “ActiveX control ‘8856f961-340a-11d0-a96b-00c04fd705a2’ cannot be instantiated because the current thread is not in a s single-threaded apartment” by using 2 functions from Opc.Ua and Opc.Ua.Configuration DLL. The strange thing is it’s working well on another GUI project, but for the DLL it doesn’t looks like good. I Verified and you correctly used [STAThread] before the Main of ScadaCommCtrl, so normally the DLL would also be on STA mode anyway. But no.
I hope Assembly.LoadFile & (KPView)Activator.CreateInstance are heriting correctly the STA mode. (I tried to modify it in the DLL, but impossible, and also make these 2 functions in another thread, in STA mode, but it’s freezing or something like this).Do you know how to debug DLLs and set breakpoints? If not, I will give you a clue. It will help to understand. Also use WriteToLog method.
Yeah I almost understood all of the logic. Tricky but clever.
April 3, 2018 at 4:23 pm #3417MikhailModeratorI’ve never met such thread issues before. To be honest, I have no advice. You should to dig deeper ))
What libraries do you use to work with OPC UA? Could you provide a link?
April 4, 2018 at 7:40 am #3419syndrome5ParticipantI’m trying a lot of stuff, very hard because they use specific configuration/target..
I based all my work on this repo : https://github.com/OPCFoundation/UA-.NETStandard and more precisely on NetCoreConsoleClient.
April 4, 2018 at 3:53 pm #3422MikhailModeratorIf it targets to .NET Core or .NET Standard, it should not use DCOM.
April 5, 2018 at 8:58 am #3424syndrome5ParticipantIt uses .NET Standard partially (I think it depends if you want interoperability). I don’t know if the dedicated functions are using DCOM or not, but I hope/think not.
Anyway I successfully bypassed this problem, but it’s a mess..April 5, 2018 at 1:57 pm #3425syndrome5Participant
Ok it works. But the signal system with all KpcLogic.Tag, DataItemInfo & others is too complicated imo.In fact, in KpOpc, we can see on CreateDaSubscr function we’re subscribing our data, and in other hand we got the function OnAddedToComLine with loading DataItemInfos.
> Why don’t just let the plugin creator to manage their vars ? Because all protocols got its specificity, and the “name” and “path” variables are not good here.
For example I created the class “ItemsOPCUA” (like Opc.Da.Items) to subs them, and so I got a Name, a Tree (for example MyServer.MyFolder.MyVar) and others things like update rate. I would like to got a function called “int assignSignal(void)” in order to add an int in my class, and so link easily.Another thing that I found complicated is to manage page on Web Interface, and particularly to add a variable anywhere. To do that, sometimes, you have to edit 3 or 4 scattered files (including Database)… Annoying.
April 6, 2018 at 3:00 pm #3428MikhailModeratorGood job!
Creating new versions, I will try to simplify the object model and configuration.
Have you tested the driver on Linux?
What are the next steps in your development?
Would you share the driver with the community?
When it is ready, I can add a link to http://demo.rapidscada.net/plugins/Store/Store.aspxApril 9, 2018 at 7:14 am #3431syndrome5ParticipantAt this moment, it doesn’t work on CentOS, I’m on it to understand why.
Also, I had to break the code where you configure vars to make Logic works. So I have to review this and manage save/load file correctly, and also verify all types of certificate work. Another annoying thing is about loading of Opc Ua configuration file (you cannot specify a path, just a name, so you have to place this file next to the exe responsible of ScadaCommSvc. And surprise (or not), it’s a service launched from System32 so files are scattered everywhere).
The code is not the best in my point of view for example about commentary aspect. Need some clean up.
So after that I’ll create a pull request with the filesApril 9, 2018 at 12:14 pm #3438MikhailModeratorDo you have a project on GitHub?
April 9, 2018 at 1:05 pm #3441syndrome5ParticipantFor this project not yet, do you want the actual code on my Github ?
April 10, 2018 at 12:02 pm #3452MikhailModeratorIt would be good if you post here a link to your repository.
April 12, 2018 at 8:31 am #3474syndrome5ParticipantHere it is : https://github.com/syndrome5/KpOpcUA
I’m worried for you about DLL needed. There is a great chance that you’ll have some issues because of that. Normally, all libraries must be in the same folder than the DLL KpOpcUA.April 12, 2018 at 11:05 am #3476MikhailModeratorThanks a lot!
Could you create a release on the GitHub repository and put there the necessary DLLs? Like hereWhat is the current state of the development? Is it ready enough to be used by the users?
April 12, 2018 at 11:20 am #3477syndrome5ParticipantI have to check which DLLs are useful or not (because I think I got some mess in my actual folder due to tests), and where should they be precisely.
I hesitate to supply a release version because I’m far away to get this title on the plugin, but I can supply DLLs in other way.Go the my github repo and check README file. As I say, the logic is working well (just start ScadaCommSvc), but the form to manage vars is not ready to be used.
It’s the most minimum possible working OPCUA-plugin. So people can use it, but I don’t recommend to trust on it too much, because I didn’t tested it deeply.
I’ve got a question about the linux working (because I’m trying to make it works on unix system) : how can I see/modify .dat files on linux ?
-
AuthorPosts
- You must be logged in to reply to this topic.