Conceptual question on event-triggered data for objects
Posted: 21 Nov 2011, 18:37
Hello Support-Team,
I have a conceptual question or rather I am not absolutely clear about the concept behind server_gettingstarted/lesson03:
I am writing my own nodemanager with application specific object types.
Therefore I use server_gettingstarted/lesson03 as a template/inspiration.
My objects (analog to the controllerobjects) are of type UaObjectTypeSimple and consist of some variables of type BaseDataVariableType. I don't have sub-classes.
So far, I implemented the nodemanager and the communication interface similar to the tutorial.
The difference between the tutorial and my application is that the data is not polled but is event triggered.
In the tutorial we have the controller objects (furnaces and airconditioners) where the new data is polled from within the bacommunicationinterface's run() function by calling the simulate() function of each controller in the m_arrayDevices array.
In my case I also implemented a class that provides the data that I want to write to the variables of the objects. But in this class I have a callback function that is called by an external event. Whenever this callback is called (not necessarily in a cyclic way), I want to write the new data to my objects.
I understand that I can set values of a variable using the setValue() function. I also know that I can get the desired node (i.e. object/variable) through it's description/nodeId by querying the nodemanager's getNode().
1. How can I best hand over my data to the variables of the objects?
2. Does it mean that I need a pointer to the nodemanager in every instance of my data providing class to set the values?
3. As it is said in the tutorial, readValue() and writeValue() are only overwritten since the data comes from polling. Thus I don't need to overwrite these functions, right?
4. What purpose does the BaUserData class have in my case? Do I need it?
I hope these questions are not to confusing and the idea behind my scenario is clear.
Thank you very much,
Felix Meßmer
I have a conceptual question or rather I am not absolutely clear about the concept behind server_gettingstarted/lesson03:
I am writing my own nodemanager with application specific object types.
Therefore I use server_gettingstarted/lesson03 as a template/inspiration.
My objects (analog to the controllerobjects) are of type UaObjectTypeSimple and consist of some variables of type BaseDataVariableType. I don't have sub-classes.
So far, I implemented the nodemanager and the communication interface similar to the tutorial.
The difference between the tutorial and my application is that the data is not polled but is event triggered.
In the tutorial we have the controller objects (furnaces and airconditioners) where the new data is polled from within the bacommunicationinterface's run() function by calling the simulate() function of each controller in the m_arrayDevices array.
In my case I also implemented a class that provides the data that I want to write to the variables of the objects. But in this class I have a callback function that is called by an external event. Whenever this callback is called (not necessarily in a cyclic way), I want to write the new data to my objects.
I understand that I can set values of a variable using the setValue() function. I also know that I can get the desired node (i.e. object/variable) through it's description/nodeId by querying the nodemanager's getNode().
1. How can I best hand over my data to the variables of the objects?
2. Does it mean that I need a pointer to the nodemanager in every instance of my data providing class to set the values?
3. As it is said in the tutorial, readValue() and writeValue() are only overwritten since the data comes from polling. Thus I don't need to overwrite these functions, right?
4. What purpose does the BaUserData class have in my case? Do I need it?
I hope these questions are not to confusing and the idea behind my scenario is clear.
Thank you very much,
Felix Meßmer