Help for bacnet and bacnet4J
-
Hi,
Thanks for your help, i didn't do that
It works know
-
Hi,
I have always the same problem with the subscriptionCOV service. I want to make it without cancellation. So from the spec we have :
13.14.1.5 Lifetime
This parameter, of type Unsigned, shall convey the desired lifetime of the subscription in seconds. A value of zero shall
indicate an indefinite lifetime, without automatic cancellation. A non-zero value shall indicate the number of seconds that
may elapse before the subscription shall be automatically cancelled. If both the 'Issue Confirmed Notifications' and 'Lifetime'
parameters are absent, then this shall indicate a cancellation request. If the 'Lifetime' parameter is present then the 'Issue
Confirmed Notifications' parameter shall be present.
So i put thisSubscribeCOVRequest service = new SubscribeCOVRequest( new UnsignedInteger(1), objectIdentifier, new Boolean(true), new UnsignedInteger(0)); try { localDevice.send(remoteDevice, service); log.info("subsciption of " + objectIdentifier.getObjectType() + "-" + objectIdentifier.getInstanceNumber() + " done"); } catch (BACnetException e) { log.error("unable to send <SubscribeCOVRequest> for the Object " + objectIdentifier.getObjectType()+ "-"+objectIdentifier.getInstanceNumber()+ "\t"+ e.getMessage()); }
I tested lifetime = null, but it doesn't work
thanks for help
-
I tested lifetime = null, but it doesn't work
You mean the request fails? If so, can you provide details of the BACnet exception?
Or do you mean that the subscription still expires? This may be due to the equipment to which you are sending the request. Or maybe not.
-
I mean that the notification doesn't work, but no exception is made.
when i send this subscription, i received just one time the notification.
-
Still don't understand. If you received any notification at all, doesn't that mean the subscription worked, at least for some time?
-
Hi,
I think I have an idea what Ilyass tries to mean :
when he uses COV on an object with a lifetime greater than 0, he receives correcty events when the PresentValue of the COVing object changes.
But when he tries with a lifetime equals to 0 (no timeout for COV subscription), he catchs only one time the COV event.
For information, in Mango, the point COVing mechanism is configure with a lifetime greather than 0 : you use COV for a certain time, and when this time is finished, you COV again. Have you got a reason to do this, instead of use a lifetime of 0?
-
It works fine for me. But let's be sure we're talking about the same thing...
In my tests i used BACnet4J as subscriber and subscribee. The subscriber sent the following request:
ObjectIdentifier oid = new ObjectIdentifier(ObjectType.binaryInput, 0); SubscribeCOVRequest req = new SubscribeCOVRequest(new UnsignedInteger(0), oid, new Boolean(true), new UnsignedInteger(0));
... received regular COV notifications from the subscribee. (Specifically, the test code is SimpleSubscriptionClient and SlaveDeviceTest, both of which are now checked into the CVS.
Note that COV subscriptions are only supported by certain object types, as enumerated in the static code block in ObjectCovSubscription (notably excuding analog objects).
-
Thank for your SimpleSubscriptionClient test file :)
Maybe you can add the unsubscribe code (because COV is done with an indefinite lifetime) :localDevice.send(d, new SubscribeCOVRequest(new UnsignedInteger(0), oid, null, null));
-
Good point. And i never answered your question...
For information, in Mango, the point COVing mechanism is configure with a lifetime greather than 0 : you use COV for a certain time, and when this time is finished, you COV again. Have you got a reason to do this, instead of use a lifetime of 0?
Infinite subscription lifetimes are convenient, but in practice they are problematic. Say the subscriber sends a 0 (infinite) lifetime. As far as it is concerned it will get COVs until it unsubscribes. But if the subscribee suffers a power failure it will likely lose the subscription, the COV notifications will stop, and the subscriber will never be the wiser.
Conversely, if the subscriber restarts unexpectedly, the subscribee will continue to send notifications that will never be received (worst case).
Using finite lease times and regular resubscriptions isn't a perfect solution to power failure (et al) situations, but it at least tends toward system stability.
-
hi there, i am currently working on a way to retrieve information from a bacnet object if there are changes. Can anyone guide me on how this can be done or is there any sample for me to understand it?
Thanks in advance! :)