• 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

    PropertyArrayIndex=null with SlaveDeviceTest

    BACnet4J general discussion
    2
    9
    3.8k
    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.
    • M
      MicheleMarcon
      last edited by

      I have downloaded and run bacnet4J 1.2, then I have tried to run the SlaveDeviceTest together with the DiscoveryTest. Of course, I have adjusted the IP address.
      This is my output:

      
      IAm receivedRemoteDevice(instanceNumber=1968, address=Address(networkNumber=0, macAddress=[a,1,a,47,8,14]), network=null)
      ObjectPropertyReference(objectIdentifier=Analog Input 0, propertyIdentifier=Object name, propertyArrayIndex=null)
      ObjectPropertyReference(objectIdentifier=Analog Input 0, propertyIdentifier=Units, propertyArrayIndex=null)
      ObjectPropertyReference(objectIdentifier=Analog Input 0, propertyIdentifier=Present value, propertyArrayIndex=null)
      RemoteDevice(instanceNumber=1968, address=Address(networkNumber=0, macAddress=[a,1,a,47,8,14]), network=null)
      
      

      This is my code on SlaveDeviceTest

      
              BACnetObject ai0x = new BACnetObject(localDevice,
                      localDevice.getNextInstanceObjectIdentifier(ObjectType.analogInput));
              ai0x.setProperty(PropertyIdentifier.objectName, new CharacterString("AAAAAaaaaAAAA"));
              ai0x.setProperty(PropertyIdentifier.units, EngineeringUnits.centimeters);
              localDevice.addObject(ai0x);
      
      

      My question is: why is the propertyArray null? Shouldn't it contain my values instead?

      Thanks.

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

        No. An ObjectPropertyReference is a reference to an object property, as the name would suggest. It is not the property value. It is the propertyArrayIndex that is null. A reference does not have a propertyArray.

        Best regards,
        Matthew

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

          Thanks! My next question is: how do I get the object property/propertyArray/whathever contains my values?

          This is the code from DiscoveryTest:

          
                  for (RemoteDevice d : localDevice.getRemoteDevices()) {
                      localDevice.getExtendedDeviceInformation(d);
                      List<ObjectIdentifier> oids = ((SequenceOf<ObjectIdentifier>) localDevice.sendReadPropertyAllowNull(d, d
                              .getObjectIdentifier(), PropertyIdentifier.objectList)).getValues();
          
                      PropertyReferences refs = new PropertyReferences();
                      for (ObjectIdentifier oid : oids)
                          addPropertyReferences(refs, oid);
          
                      PropertyValues pvs = localDevice.readProperties(d, refs);
                      // pvs.
                      Iterator<ObjectPropertyReference> i=pvs.iterator();
                      while (i.hasNext()){
                      System.out.println(i.next());
                      }
                      System.out.println(d);
                  }
          
          
          
          1 Reply Last reply Reply Quote 0
          • M
            mlohbihler
            last edited by

            That's pretty much it, yes.

            Best regards,
            Matthew

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

              On the SlaveDeviceTest, I have set

              
              ai0x.setProperty(PropertyIdentifier.objectName, new CharacterString("AAAAAaaaaAAAA"));  
              ai0x.setProperty(PropertyIdentifier.units, EngineeringUnits.centimeters); 
              

              How do I get them on the DiscoveryTest?

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

                To clarify: I don't know how to get the property values. The code posted prints the reference instead of the actual values...

                Please let me know how to rectify this, thanks.

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

                      PropertyValues pvs = localDevice.readProperties(d, refs);  
                      Iterator&lt;ObjectPropertyReference&gt; i=pvs.iterator();  
                      while (i.hasNext()){  
                          PropertyValue pv = pvs.get(i.next());
                          System.out.println(pv);  
                      }  
                  

                  Best regards,
                  Matthew

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

                    It works! Many thanks! :mrgreen: :mrgreen: :mrgreen:

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