• Recent
    • Tags
    • Popular
    • Register
    • Login

    Please Note This forum exists for community support for the Mango product family and the Radix IoT Platform. Although Radix IoT employees participate in this forum from time to time, there is no guarantee of a response to anything posted here, nor can Radix IoT, LLC guarantee the accuracy of any information expressed or conveyed. Specific project questions from customers with active support contracts are asked to send requests to support@radixiot.com.

    Radix IoT Website Mango 3 Documentation Website Mango 4 Documentation Website Mango 5 Documentation Website

    Help for bacnet and bacnet4J

    BACnet4J general discussion
    4
    21
    31.1k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • I
      ilyass
      last edited by

      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 this

      
      SubscribeCOVRequest 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

      1 Reply Last reply Reply Quote 0
      • M
        mlohbihler
        last edited by

        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.

        Best regards,
        Matthew

        1 Reply Last reply Reply Quote 0
        • I
          ilyass
          last edited by

          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.

          1 Reply Last reply Reply Quote 0
          • M
            mlohbihler
            last edited by

            Still don't understand. If you received any notification at all, doesn't that mean the subscription worked, at least for some time?

            Best regards,
            Matthew

            1 Reply Last reply Reply Quote 0
            • J
              jeremie
              last edited by

              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?

              1 Reply Last reply Reply Quote 0
              • M
                mlohbihler
                last edited by

                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).

                Best regards,
                Matthew

                1 Reply Last reply Reply Quote 0
                • J
                  jeremie
                  last edited by

                  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));
                  
                  
                  1 Reply Last reply Reply Quote 0
                  • M
                    mlohbihler
                    last edited by

                    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.

                    Best regards,
                    Matthew

                    1 Reply Last reply Reply Quote 0
                    • R
                      R-GiGgS84
                      last edited by

                      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! :)

                      1 Reply Last reply Reply Quote 0
                      • First post
                        Last post