• 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

    Invalid Data Type

    BACnet4J general discussion
    2
    3
    1.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.
    • J
      Joshua
      last edited by

      Hi again,

      We're trying to send a WritePropertyRequest to the Present Value property of a Binary Value object, however the response (ack) we get back from the remote device is an error, with errorClass = 2 // property and errorCode = 9 // invalidDataType. We're sending a property value of type Boolean, which is what I'd expect to be the accepted data type for a binary value, but maybe I'm wrong. Also I'm not quite sure about the propertyArrayIndex parameter. So I guess I'm wondering if the following parameters are correct:

      // Kotlin
      localDevice.send(remoteDevice,
                       WritePropertyRequest(ObjectIdentifier(ObjectType.binaryValue, 2), // object
                                            PropertyIdentifier.presentValue, // property
                                            null, // propertyArrayIndex. null since the present value property is not an array (?)
                                            Boolean.valueOf(true), // propertyValue
                                            UnsignedInteger(1)), // priority
                        ResponseConsumer())
      

      Thanks in advance,
      Joshua

      1 Reply Last reply Reply Quote 0
      • phildunlapP
        phildunlap
        last edited by phildunlap

        Hi Joshua,

        Have a look at https://github.com/infiniteautomation/BACnet4J/blob/master/src/main/java/com/serotonin/bacnet4j/obj/ObjectProperties.java

        Which correlates ObjectType, PropertyIdentifier, the data type of the property, whether it is required, and whether it is an array. Specifically, you want this: https://github.com/infiniteautomation/BACnet4J/blob/e1550a4731d79a9649f376654526beaa0fd12e48/src/main/java/com/serotonin/bacnet4j/obj/ObjectProperties.java#L905

        which is:

        add(ObjectType.binaryValue, PropertyIdentifier.presentValue, BinaryPV.class, true);
        

        And shows the presentValue of a binaryValue is a BinaryPV type.(and required; not an array). You should be fine leaving the propertyArrayIndex null on that write.

        J 1 Reply Last reply Reply Quote 0
        • J
          Joshua @phildunlap
          last edited by

          @phildunlap Perfect, thank you. Not sure how I missed that file before, but it will be extremely useful in the future.

          Cheers!

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