16:01, EEST
June 21, 2021
Hi,
In my information model I have a type (MachineType), I have generated this class with codegen in my server application. My wish is to historize the values of the properties of this type in database.
Does the SDK provide a way to historicize a custom node (MachineType) and save the history to a database?
17:00, EEST
April 3, 2012
Hi,
Basically the SDK has nothing to help with that. Can you be more specific on about what exactly you would have hoped we would have? Maybe we could add some, however I would say even more with databases that they are typically in the application level realm and are basically custom formats so I’m like not exactly sure what help we could have. One thing that has been requested a few times is XML serialization support (we only have the decoding part), but it would not help here.
Anyway, I would say it is also somewhat abnormal that the “true data-backend” would really be “OPC UA”, typically it is something application specific. Only like in the case of e.g. our SimulationServer it is as it has basically no real data source per se as everything is simulated (and that has an internal application specific experiment on serializing things back to nodesets, but it is not yet part of the SDK and probably cannot be in it’s current form due to dependencies). Basically applications typically have some real source, like e.g. in our ModbusServer it is the ModBus devices, which would then be transformed to the OPC UA Address space.
So most likely as a simplified example you might have a table MACHINES, where each row is something that would equal to one MachineType instance and the columns would have it’s data. But the format would basically (most likely) not OPC UA, like you could have a NAME column, then when the server starts use that as the basis of NodeId, BrowseName and DisplayName. The rest of the type-structure i.e. the nodes below the main node would come from the type’s definition automatically when you nodeManager.createInstance that type (like the alarm type in the samples MyNodeManager).Though in general our support doesn’t cover application design, it is more like technical only i.e. if there are problems with the SDK (we have https://www.prosysopc.com/services/ if you need a project or more specific help).
However, there are at least 2 notes I should make:
1. You might be better of with a Method that would do adding the new MachineType instance than the AddNodes call from the client. Because assuming the info about the machine is as such that it could be contained in the Method Call (UaClient.call(…)) i.e. not infinitely long/large, you could feed that directly to the DB and then make the instance, i.e. you would be immediately aware of the new data instead of having to look it up (or react to it via the ‘createNodeForNodeSet2’ I mentioned in my first reply in https://forum.prosysopc.com/forum/opc-ua-java-sdk/set-node-values-from-client-to-server/.
2. At least once look at MyBigNodeManager in the sampleconsoleserver example. That is basically a way to make the address space if your data is not in the nodes. However, this way is not compatible with the Codegen outputs as this manager (very specifically) doesn’t use UaNodes, all the data is basically “created on the fly” from whatever datasource you have. Preferably some day I would find a way to combine this with the UaNodes+Codegen, but that requires a lot of time from us and will not happen anytime soon if ever. So making the nodes here are more complicated as you would need to do all references manually, but in turn there is no need sort of to “persist the data” as all the data is basically obtained from the database whenever it is asked i.e. the server in this case would not store it per se as compared to the UaNodes way.
16:09, EEST
April 3, 2012
If you can tell us exactly what you want to do and why, I might be able to give a better answer.
But as to “opc ua method” the answer is ‘no’ assuming I understood the question correctly. Basically the ‘AddNodes service call’ explained in the other forum posts would be I guess what is “defined in OPC UA”. Though, it should be noted that most of the time it is not used and servers do not support it. It might not be the best way to do it, but it depends what you want to do and is e.g. any 3rd party client intended to also be interoperable with the server (calling a method would be … most likely the better option).
Depending on the information model it might not define how exactly the types would be instantiated. You can like define such method in the information model, but there isn’t anything “special” per se about it, it would be just a method among others, and in the implementation of that you would make the instance. This method most likely would not be part of a TypeDefinition (or no ModellingRule attached to it at least) i.e. it would not be code-generated (it would be more like a static method on a class in programming languages), but it could be implemented like the MyNodeManager.createMethodNode+MyMethodManagerListener in the sampleconsoleserver.
Most Users Ever Online: 1919
Currently Online:
17 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: 735
Moderators: 7
Admins: 1
Forum Stats:
Groups: 3
Forums: 15
Topics: 1523
Posts: 6449
Newest Members:
rust, christamcdowall, redaahern07571, nigelbdhmp, travistimmons, AnnelCib, dalenegettinger, howardkennerley, Thomassnism, biancacraft16Moderators: Jouni Aro: 1026, Pyry: 1, Petri: 0, Bjarne Boström: 1026, Jimmy Ni: 26, Matti Siponen: 346, Lusetti: 0
Administrators: admin: 1