7:10, EEST
August 20, 2014
Hello,
i’m using the Java SDK Evaluation- 2.0.0-194.
I wanted to try the codegenerator. So i downloaded the UaModeler an created an xml file based on my informationmodel (very small, only 7 nodes).
Then i followed the readme.md from the folder codegen. I copied the xml file into the codegen folder. Then i edited the codegen.properties file.
Then i ran the codegen-2.0.0-standalone with all the necessary Parameters.
Now i dont’t know what i’m doing wrong?
My result is: the impl- folder is empty, in the intf- folder i have only 1 file InormationModel.java.
Tanks
Ibrahim
14:05, EEST
December 21, 2011
14:15, EEST
August 20, 2014
8:59, EEST
December 21, 2011
You need code generation to convert the UA type definitions to the respective Java classes, which you can then use in application development.
If you only define instances (objects and variables), you can just load the information model XML to your application to get the instances in the address space.
9:34, EEST
August 20, 2014
8:17, EEST
August 20, 2014
9:16, EEST
December 21, 2011
8:06, EEST
August 20, 2014
10:08, EEST
December 21, 2011
15:20, EEST
August 20, 2014
9:21, EEST
August 20, 2014
Hi,
i’m trying to make one of the variableTypes created by the generator historising.I tried to use the class MyHistorian from the SDK, but that doesen’t work, because the function addVariableHistory needs a UaVariableNode as parameter. So, how can i historise my custom created Variables?
Thanks.
12:33, EEST
December 21, 2011
MyHistorian is just an example. You should create your own according to your own needs, but you can take that one as a basis.
All variable nodes generated by the code generator should descend from UaVariableNode, though, so it should work for those variables as well. You cannot add a variable type, you need to add variable instances.
14:08, EEST
August 20, 2014
13:41, EEST
August 20, 2014
Hi,
i still have the same problem. My generated Class extends from BaseDataVariableType. I create an instance from that type. What do i have to do now, to make that instance hitorizing? The funktion addVariableHistory does not accept that instance as parameter. Could you please post an example of how to create an instance from my generated classes which will be accepted from addVariableHistory?
Thanks..
9:06, EEST
December 21, 2011
9:28, EEST
August 20, 2014
OK,
first i create an instance of DHT22 in my NodeManager, DHT22 extends BaseDataVariableType. The class DHT22 was created by the codegen.
MyHistorian history = new MyHistorian();
DHT22 dht22;
then i try the following:
public void inithistory() throws StatusException{
getHistoryManager().setListener(history);
dht22.setHistorizing(true);
history.addVariableHistory(dht22);
}
but the funktion addVariableHistory doesent accept dht22, because it is not UaVariableNode.
12:40, EEST
December 21, 2011
Ah, OK, I think I get it, now.
DHT22 is the interface type. You must declare the variable as DHT22Node, which is the generated server implementation. It descends from UaVariableNode – whereas DHT22 descends from UaVariable.
The NodeBuilder or NodeManagerUaNode.createInstance() will create it as a DHT22Node anyway.
The usage of the interface vs. the class type is not perfectly clear yet in every respect. So you may need to use the class types (XxxNode) in the server for certain things instead of the interface.
13:00, EEST
August 20, 2014
Most Users Ever Online: 1919
Currently Online:
28 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: 738
Moderators: 7
Admins: 1
Forum Stats:
Groups: 3
Forums: 15
Topics: 1524
Posts: 6451
Newest Members:
jonathonmcintyre, fannielima, kristiewinkle8, rust, christamcdowall, redaahern07571, nigelbdhmp, travistimmons, AnnelCib, dalenegettingerModerators: Jouni Aro: 1026, Pyry: 1, Petri: 0, Bjarne Boström: 1026, Jimmy Ni: 26, Matti Siponen: 346, Lusetti: 0
Administrators: admin: 1