Source Code KpOpc.dll

Forum Home Forums Development and Integration Source Code KpOpc.dll

Tagged: 

Viewing 15 posts - 16 through 30 (of 51 total)
  • Author
    Posts
  • #3392
    Mikhail
    Moderator

    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.

    #3414
    syndrome5
    Participant

    As 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.

    #3417
    Mikhail
    Moderator

    I’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?

    #3419
    syndrome5
    Participant

    I’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.

    #3422
    Mikhail
    Moderator

    If it targets to .NET Core or .NET Standard, it should not use DCOM.

    #3424
    syndrome5
    Participant

    It 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..

    #3425
    syndrome5
    Participant

    img
    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.

    #3428
    Mikhail
    Moderator

    Good 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.aspx

    #3431
    syndrome5
    Participant

    At 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 files

    #3438
    Mikhail
    Moderator

    Do you have a project on GitHub?

    #3441
    syndrome5
    Participant

    For this project not yet, do you want the actual code on my Github ?

    #3452
    Mikhail
    Moderator

    It would be good if you post here a link to your repository.

    #3474
    syndrome5
    Participant

    Here 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.

    #3476
    Mikhail
    Moderator

    Thanks a lot!
    Could you create a release on the GitHub repository and put there the necessary DLLs? Like here

    What is the current state of the development? Is it ready enough to be used by the users?

    #3477
    syndrome5
    Participant

    I 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 ?

Viewing 15 posts - 16 through 30 (of 51 total)
  • You must be logged in to reply to this topic.