12:34, EEST
July 22, 2014
In the sample server, you can type ‘e’ to send an event.
But how can you get to the point where the sample client prints out the event in a log message?
I tried the subscription menu item with various nodes selected, but didn’t see any log output.
By the way, I noticed a null pointer exception while trying to do this.
It seems that a call to ‘ initEventFieldNames()’ is missing in ‘createMonitoredEventItem(NodeId nodeId)’,
so that the last two items in the ‘eventFieldNames’ array remain null.
Thanks
10:09, EEST
December 21, 2011
15:17, EEST
July 22, 2014
I am using code similar to the sample server’s MyNodeManager.sendEvent() method to send events, but can’t seem to receive any events in the client.
The client code calls “subscribe(myVariableId, Attributes.EventNotifier)”, where the subscribe() method is based on the one in SampleConsoleClient.
The event is based on the MyEventType class.
I noticed that the createAlarmNode() method in the sample server has these calls (which my code doesn’t have yet, since I didn’t add alarms yet):
source.addReference(myAlarm, Identifiers.HasCondition, false);
myDevice.addReference(source, Identifiers.HasEventSource, false);
myObjectsFolder.addReference(myDevice, Identifiers.HasNotifier, false);
Do I need to make similar calls to register the event?
Please let me know when there is a fixed version of the sample code where the ‘e’ command for sending events works, so I can see how it is done there.
Thanks!
13:07, EEST
December 21, 2011
13:30, EEST
December 21, 2011
13:31, EEST
December 21, 2011
11:04, EEST
July 22, 2014
> BTW: ‘initEventFieldNames()’ call is in the ‘createMonitoredEventItem()’ of the SampleConsoleClient. Are you sure, you have the original version?
You are right. I must have accidentally deleted that line.
> And to clarify: you can always listen to the Server object to get all events from the server.
So you would call (in the sample client):
subscribe(Identifiers.RootFolder, Attributes.EventNotifier);
?
That didn’t work for me (I did modify the event filter to leave out the “where” clause).
At least my SubscriptionNotificationListener.onEvent() method was never called.
11:24, EEST
December 21, 2011
11:36, EEST
July 16, 2015
Hi,
I was also trying to setup events bewteen server and client.
I have a folder in which the objects of my Information Model are placed. EventNotifier for this folder is set to SubscribeToEvents.
When I try to subscribe this folder from client with attributeId=12 i.e. EventNotifier, I get and exception:
07/17/2015 16:57:25.153 DEBUG [Blocking-Work-Executor-2] com.prosysopc.ua.client.UaClient – handlePublishResponse: response=1
07/17/2015 16:57:25.153 DEBUG [PublishTask-com.prosysopc.ua.client.UaClient@15bf497] com.prosysopc.ua.client.nodes.UaNodeImpl – getProperty: name=MaxNodesPerRead
07/17/2015 16:57:25.153 DEBUG [Blocking-Work-Executor-2] com.prosysopc.ua.client.UaClient$a – ServiceException:
com.prosysopc.ua.ServiceException ServiceResult=BAD (0x80000000) “” Diagnostics=Diagnostic Info:
at com.prosysopc.ua.client.UaClient.a(Unknown Source)
at com.prosysopc.ua.client.UaClient.a(Unknown Source)
at com.prosysopc.ua.client.UaClient$a.onCompleted(Unknown Source)
at org.opcfoundation.ua.transport.impl.AsyncResultImpl$2.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
I guess because of this exception my subscription is not created correctly and I am not able to receive events on Client.
Please provide guidance.
Thanks
12:53, EEST
April 3, 2012
Hi,
The exception happens because the ServiceResult statuscode of the PublishResponse is Bad, therefore we do not process it.
Weird is that the returned status code is just a plain BAD instead of more precise error code, therefore it is a bit hard to say what the actual problem is.
Which server you are connecting to? Also in case it might be relevant, which SDK version you are using?
There is no diagnostics info returned, so either server did not return anything or diagnostics are off. Check Root/Objects/Server/ServerDiagnostics/EnabledFlag and write it to be true (or maybe there is option to turn it on in server configuration).
Is there anything in the server logs while this happens?
Most Users Ever Online: 1919
Currently Online:
10 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: 731
Moderators: 7
Admins: 1
Forum Stats:
Groups: 3
Forums: 15
Topics: 1529
Posts: 6471
Newest Members:
inilarythikibia, rickykennion, PromotionToold, HypromeImpupe, toneylapham544, rondawolinski7, Marypof5711, roycedelargie91, kourtneyquisenbe, ellis87832073466Moderators: Jouni Aro: 1026, Pyry: 1, Petri: 0, Bjarne Boström: 1032, Jimmy Ni: 26, Matti Siponen: 349, Lusetti: 0
Administrators: admin: 1