• 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

    Set present value to int of hex values

    BACnet4J general discussion
    2
    2
    1.5k
    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

      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.UnsignedInteger

      Thanks

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

        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);
        
        1 Reply Last reply Reply Quote 0
        • First post
          Last post