17:15, EEST
March 26, 2021
Hello,
It’s not clear to me if and how you can add an item to the server at the request of the client, using I suppose the OnAddItem event of the TPsOPCProviderGroup class.
I couldn’t find an example of this in the examples provided, and the doc doesn’t say anything either. Am I going about this the wrong way? Is it possible to add an item that does not yet exist in this way in the server?
Thanks in advance.
Denis
18:54, EEST
March 26, 2021
Actually my problem is more annoying. I also need to be able to create items that are not necessarily strings of the pascal language identifier type. For example, a possible item in my OPC server could be something like: “MyVar[5].Field1”. The server I want to replace worked in this way. How is it possible to get the same result with your library?
Thank you.
Denis
11:14, EEST
December 21, 2011
Hi Denis, Thanks for a good question.
TPsOPCProvider.OnFindItem is the best place for this. It’s called whenever the OPC Provider tries to find the component matching an ItemID, so in practice, when the client apps call AddItems. You can interpret the ItemID in your own style and return a reference to a new variable (or any other component), as necessary. If you return other than variables, they will work as “folders” or OPC Branches, instead of data items or OPC Leaves.
16:27, EEST
March 26, 2021
When creating the variables that must be able to be browsed by the client, if we use components of type TPsVar, TPsBool, etc., is the itemID returned to the client necessarily the “name” property of the component, or is it possible to return a different itemID?
In this case, perhaps it is necessary to use another way to define the available variables and their ItemID?
Thanks in advance
17:38, EEST
December 21, 2011
Unfortunately, there are no good examples.
But, basically, you can define the contents of the AddressSpace as you like.
By default, the AddressSpace will be filled with variables that are found in all forms and data modules that are added to the Application. You can use ‘PsOPCProvider.AddressSpace.AutoAddApplication := False;’ to disable this default logic. Use AddVariable(s) to add what you need in there. You can provide a custom name for each to be used in the address space. This is probably the easiest way to do it. See the help for ‘TPsOPCProviderAddressSpace’.
You will only need to use OnFindItem, if you wish to create variables dynamically, upon client request, instead of predefining everything.
10:48, EEST
March 26, 2021
Thank you very much for the help and support. I now have a DA server that seems to be working fine, with which items are created on demand by the client. Not being able to list the available items on the client side is still a drawback.
I will now switch to UA. Will I be able to set up a system that works in a similar way? Will the TPsVar descendant objects used for the DA server work the same way for UA?
Thank you in advance
17:24, EEST
December 21, 2011
17:25, EEST
December 21, 2011
12:58, EEST
December 21, 2011
Hmm, I am trying to think how does this apply to OPC UA in fact. I guess you can add nodes dynamically upon request there as well, although the assumption is more like that the address space is defined by the server and if modifications are allowed they are done via the AddNodes service.
In any case, at the moment the solution is to create your own version of a NodeManagerUaNode and override methods in there. You could override TryGetNode, which is used whenever a node is looked up by it’s NodeId.
18:32, EEST
March 26, 2021
Thank you, it works very well.
My OPC UA server is almost functional, but I’m still missing some small details.
– To forbid the writing of a TUaVariable by the client, AccessLevel must contain [altCurrentRead], is that right? But the variable is still accessible and modified by the client.
– How do we get the information about the connected clients (IP address, name of the client software, others)?
16:44, EEST
December 21, 2011
19:40, EEST
March 26, 2021
Thank you for your help.
Unfortunately this doesn’t seem to work, I do create the exception you indicated, but despite this the client receives a success status.
I am coming to the end of the one month trial extension tomorrow. I’ll probably have to stop testing, as I don’t know when we’ll order the licenses from you, hopefully next week. I would ask you for another extension, but I’m afraid I’m taking it a bit too far ? Anyway, thank you for your support until now.
Most Users Ever Online: 1919
Currently Online:
18 Guest(s)
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Heikki Tahvanainen: 402
hbrackel: 144
rocket science: 88
pramanj: 86
Francesco Zambon: 83
Ibrahim: 78
Sabari: 62
kapsl: 57
gjevremovic: 49
Xavier: 43
Member Stats:
Guest Posters: 0
Members: 734
Moderators: 7
Admins: 1
Forum Stats:
Groups: 3
Forums: 15
Topics: 1529
Posts: 6471
Newest Members:
Garmcrypto7Zof, calebhardison, susannahdingle7, inilarythikibia, rickykennion, PromotionToold, HypromeImpupe, toneylapham544, rondawolinski7, Marypof5711Moderators: Jouni Aro: 1026, Pyry: 1, Petri: 0, Bjarne Boström: 1032, Jimmy Ni: 26, Matti Siponen: 349, Lusetti: 0
Administrators: admin: 1