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.
Invalid Data Type
-
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 // propertyanderrorCode = 9 // invalidDataType. We're sending a property value of typeBoolean, 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 thepropertyArrayIndexparameter. 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 -
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.
-
@phildunlap Perfect, thank you. Not sure how I missed that file before, but it will be extremely useful in the future.
Cheers!
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login