• 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

    How to know the type of the object ?

    BACnet4J general discussion
    2
    4
    3.3k
    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.
    • V
      Valter Henrique
      last edited by

      Hi everyone,
      i was thinking how to know if the object is 'analog output' or 'analog input' ? the same to binary type.

      in Test2.java you can :

      
          private static void getObjectList(LocalDevice localDevice, String ip, int port, int deviceId) throws Exception {
              InetSocketAddress addr = new InetSocketAddress(InetAddress.getByName(ip), port);
              ReadPropertyRequest read = new ReadPropertyRequest(new ObjectIdentifier(ObjectType.device, deviceId), PropertyIdentifier.objectList);
              ReadPropertyAck ack = (ReadPropertyAck) localDevice.send(addr, null, 1476, Segmentation.segmentedBoth, read);
      
              System.out.println("IP: " + ip);
              SequenceOf<ObjectIdentifier> oids = (SequenceOf<ObjectIdentifier>) ack.getValue();
              for (ObjectIdentifier oid : oids)
                  System.out.println("    " + oid);
          }
      
      

      But if i try get only the analogOutput like this:

      
          private static void getAnalogOutputList(LocalDevice localDevice, String ip, int port, int deviceId) throws Exception {
              InetSocketAddress addr = new InetSocketAddress(InetAddress.getByName(ip), port);
              ReadPropertyRequest read = new ReadPropertyRequest(new ObjectIdentifier(ObjectType.analogOutput, deviceId), PropertyIdentifier.presentValue);
              ReadPropertyAck ack = (ReadPropertyAck) localDevice.send(addr, null, 1476, Segmentation.segmentedBoth, read);
              
              System.out.println("IP: " + ip);
              SequenceOf<ObjectIdentifier> oids = (SequenceOf<ObjectIdentifier>) ack.getValue();
              for (ObjectIdentifier oid : oids) {
                  System.out.println("    " + oid);
              }
          }
      
      

      Launch a exception:

      ErrorAPDU(choice=12, errorClass=Object, errorCode=Unknown object)

      Could anyone help me with this ?

      1 Reply Last reply Reply Quote 0
      • B
        buttonville
        last edited by

        you still need to ask for complete objectList
        then only show analogOutput

        
        	private static void getObjectList(LocalDevice localDevice, String ip, int port, int deviceId) throws Exception 
        	{  
        		InetSocketAddress addr = new InetSocketAddress(InetAddress.getByName(ip), port);  
        		ReadPropertyRequest read = new ReadPropertyRequest(new ObjectIdentifier(ObjectType.device, deviceId), PropertyIdentifier.objectList);  
        		ReadPropertyAck ack = (ReadPropertyAck) localDevice.send(addr, null, 1476, Segmentation.segmentedBoth, read);  
        
        		System.out.println("IP: " + ip);  
        		SequenceOf<ObjectIdentifier> oids = (SequenceOf<ObjectIdentifier>) ack.getValue();  
        		for (ObjectIdentifier oid : oids)  
        		{
        			if(oid.getObjectType().intValue() == ObjectType.analogOutput.intValue())
        			{
        				System.out.println("    " + oid);
        			}
        		}
        	}  
        
        
        1 Reply Last reply Reply Quote 0
        • V
          Valter Henrique
          last edited by

          sorry taking so long to reply friend. (I was involved in another project, but now returning to bacnet4j )

          I try what you suggest but it just told me the value of the binary and the analog, which is :

          Object type || value
          Device : 8
          Analog Value : 2
          Binary Value : 5

          What I need is a little more specific, how to know the int value of a binary input for example ?

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