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.
Set present value to int of hex values
-
Hi, I have this code:
systemStatus1 = new BACnetObject(localDevice, localDevice.getNextInstanceObjectIdentifier(ObjectType.analogInput)); systemStatus1.setProperty(PropertyIdentifier.objectName, new CharacterString("System status group 1")); systemStatus1.setProperty(PropertyIdentifier.units, EngineeringUnits.noUnits); systemStatus1.setProperty(PropertyIdentifier.presentValue, new Real(65535)); localDevice.addObject(systemStatus1);
As you can see, I'm inserting a
Real
with value 65535, which gets translated into 65535.00.
Is there a way to set a integer value? I've tried with UnsignedInteger
but I get
com.serotonin.bacnet4j.exception.BACnetServiceException: class=Property, code=Invalid data type, message=expected class com.serotonin.bacnet4j.type.primitive.Real, received=class com.serotonin.bacnet4j.type.primitive.UnsignedIntegerThanks
-
Hi Michele,
I am not an expect on the BACnet4J code, but I do try to dabble and help people a little when I can. But,
I think you cannot have an UnsignedInteger for a object with the type of AnalogInput. Looking in ObjectProperties suggests the following support a presentValue property set to the UnsignedInteger type:
ObjectType. accumulator command multiStateInput multiStateOutput multiStateValue positiveIntegerValue
So it sounds to me like you may be looking for,
systemStatus1 = new BACnetObject(localDevice, localDevice.getNextInstanceObjectIdentifier(ObjectType.positiveIntegerValue)); systemStatus1.setProperty(PropertyIdentifier.objectName, new CharacterString("System status group 1")); systemStatus1.setProperty(PropertyIdentifier.units, EngineeringUnits.noUnits); systemStatus1.setProperty(PropertyIdentifier.presentValue, new UnsignedInteger(65535)); localDevice.addObject(systemStatus1);