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.

  • Step by step to build Mango

    3
    0 Votes
    3 Posts
    3k Views
    F
    If you have the sources look at this topic. http://mango.serotoninsoftware.com/forum/posts/list/268.page#1223 If not, try ScadaBR.
  • BBMD Support

    2
    0 Votes
    2 Posts
    3k Views
    F
    Are there any plans to support BBMD in BACnet4J? Thanks.
  • Object list request leeds to "Property: Characterset not supported '4'"

    2
    0 Votes
    2 Posts
    2k Views
    J
    Doing a object list request leeds to the error message Property: Characterset not supported '4' on the affected device only characterset supported is ANSI_X3_4 which seems to be ok for me The device can be read form WebCTRL without any problems. Are there some configuration issues a have overseen ? I am new with m2m2 Heinz
  • Bug in PropertyStates class

    2
    0 Votes
    2 Posts
    3k Views
    J
    In com.serotonin.bacnet4j.type.constructed.PropertyStates.java:118 public PropertyStates(int type, BaseType state) { this.state = new Choice(type, state); } I think it should be public PropertyStates(int type, Encodable state) { this.state = new Choice(type, state); } Most of the possible choices for a PropertyStates object are of Enumerated type, which doesn't extend from BaseType. The Choice constructor takes an Encodable as its parameter, so it should work. In my own testing, it appears to work just fine.
  • Bug in class AcknowledgementService

    3
    0 Votes
    3 Posts
    3k Views
    R
    the missing class: package com.serotonin.bacnet4j.service.acknowledgement; import com.serotonin.bacnet4j.exception.BACnetServiceException; import com.serotonin.util.queue.ByteQueue; public class DeleteObjectAck extends AcknowledgementService { private static final long serialVersionUID = 3837098889443642131L; public static final byte TYPE_ID = 11; public DeleteObjectAck() { } @Override public byte getChoiceId() { return TYPE_ID; } @Override public void write(ByteQueue queue) { } DeleteObjectAck(ByteQueue queue) throws BACnetServiceException { } @Override public String toString() { return "DeleteObjectAck()"; } @Override public int hashCode() { final int PRIME = 31; int result = 1; result = PRIME * result; return result; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; final DeleteObjectAck other = (DeleteObjectAck) obj; if (this == other) return true; else return false; } } the result is not used anyway - if it fails the exception and the appr. error will be catched.
  • Missing code in class ObjectTypesSupported

    2
    0 Votes
    2 Posts
    2k Views
    B
    i wonder if com.serotonin.bacnet4j.type.constructed.ObjectTypesSupported should be completed by public boolean isGlobalGroup() { return getValue()[26]; } public void setGlobalGroup(boolean globalGroup) { getValue()[26] = globalGroup; }
  • How read and write values from local devices ?

    11
    0 Votes
    11 Posts
    9k Views
    V
    @Valter Henrique said: Hi everyone, i need to read the values of my objects, i only can read the instance number: private static void getObjectList(LocalDevice localDevice, String ip, int port, int deviceId, float value) 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(); int i = 0; for (ObjectIdentifier oid : oids) { System.out.println("-------- " + oid.getInstanceNumber()); } } But how read the value of each object ? For example, i would like to read '15' from my analog output object, o true or false from my digital values and go on. [image: Captura_01May301857.jpg] I try to write this code: InetSocketAddress addr = new InetSocketAddress(InetAddress.getByName(ip), port); ReadPropertyRequest read = new ReadPropertyRequest(new ObjectIdentifier(ObjectType.analogOutput, deviceId), PropertyIdentifier.priorityArray); ReadPropertyAck ack = (ReadPropertyAck) localDevice.send(addr, null, 1476, Segmentation.segmentedBoth, read); PriorityArray priorityArray = (PriorityArray) ack.getValue(); float priority = priorityArray.get(16).getRealValue().floatValue(); System.out.println("priorityArray = " + priority); But is not working. Could anyone help me with this please ? Best regards, Valter Henrique. Hi, someone could help me with this please ? mlohbihler , could you help me, please ? Thanks in advance.
  • How get/set value from my device ?

    11
    0 Votes
    11 Posts
    8k Views
    G
    Thanks for your code Actually I need to understand the classes of Bacnet4j.. I am seeing bacnet packages in Wireshark when I sent bacnet packets from Virtual Test Shell. .. What must I write the argument of LocalDevice class to capture these package in Bacnet4j lib in java? WireShark and VTS is in my local computer so do I must write localhost in LocalDevice as a argument? All I want is to manage and control the bacnet device from Bacnet4j lib ... I am beginner of these library and there is no document to study on, so I need to understand and learn what it is going on..
  • ClassCastException in PropertyStates

    2
    0 Votes
    2 Posts
    3k Views
    J
    When a com.serotonin.bacnet4j.type.constructed.ProptertyStates object is instantiated via the PropertyStates(int type, BaseType state) constructor, the getState() function will work fine as a BaseType object is required. However, when a PropertyStates object is instantiated via the public PropertyStates(ByteQueue queue) constructor, the getState() function can generate ClassCastExceptions if it is not a BaseType. In my case, I had a ClassCastException because this.state was a BinaryPV, which isn't a BaseType. Changing public BaseType getState() { return (BaseType) state.getDatum(); } to this public Encodable getState() { return state.getDatum(); } resolves the problem. Or if getState returned this.state, that should probably work too.
  • ArrayIndexOutOfBoundsException in CommandPriorityTest

    5
    0 Votes
    5 Posts
    4k Views
    V
    @mlohbihler, i follow your suggestion and happens what you say, no remote devices responds. I think in my case is just local devices . Well, this is my code if could help anyone: /* Copyright (C) 2006-2009 Serotonin Software Technologies Inc. @author Matthew Lohbihler */ package com.bacnet.ready; import com.serotonin.bacnet4j.LocalDevice; import com.serotonin.bacnet4j.RemoteDevice; import com.serotonin.bacnet4j.RemoteObject; import com.serotonin.bacnet4j.service.acknowledgement.ReadPropertyAck; import com.serotonin.bacnet4j.service.confirmed.ReadPropertyRequest; import com.serotonin.bacnet4j.service.confirmed.WritePropertyRequest; import com.serotonin.bacnet4j.service.unconfirmed.WhoHasRequest; import com.serotonin.bacnet4j.service.unconfirmed.WhoIsRequest; import com.serotonin.bacnet4j.type.Encodable; import com.serotonin.bacnet4j.type.enumerated.PropertyIdentifier; import com.serotonin.bacnet4j.type.primitive.CharacterString; import com.serotonin.bacnet4j.type.primitive.Null; import com.serotonin.bacnet4j.type.primitive.Real; import com.serotonin.bacnet4j.type.primitive.UnsignedInteger; /** * @author Matthew Lohbihler */ public class CommandPriorityTest { private static LocalDevice localDevice; private static RemoteDevice remoteDevice; private static RemoteObject remoteObject; public static void main(String[] args) throws Exception { String objectName = "Command Priority Test"; localDevice = new LocalDevice(101, "192.168.1.255"); localDevice.initialize(); // Who is localDevice.sendBroadcast(47808, null, new WhoIsRequest()); Thread.sleep(1000); // Who has localDevice.sendBroadcast(47808, null, new WhoHasRequest(null, new CharacterString(objectName))); // Wait a bit for responses to come in. Thread.sleep(1000); // Find the device if (localDevice.getRemoteDevices().isEmpty()) { System.out.println("No devices responded"); } else { remoteDevice = localDevice.getRemoteDevices().get(0); // localDevice.getExtendedDeviceInformation(remoteDevice); // List<ObjectIdentifier> oids = ((SequenceOf<ObjectIdentifier>)localDevice.sendReadPropertyAllowNull( // remoteDevice, remoteDevice.getObjectIdentifier(), PropertyIdentifier.objectList)).getValues(); // for () // remoteDevice.setObject(new RemoteObject()) // Find the object. for (RemoteObject o : remoteDevice.getObjects()) { if (o.getObjectName().equals(objectName)) { remoteObject = o; break; } } getPresentValue(); getPriorityArray(); setPresentValue(new Real(16), 16); getPresentValue(); getPriorityArray(); setPresentValue(new Real(15), 15); getPresentValue(); getPriorityArray(); setPresentValue(new Null(), 16); getPresentValue(); getPriorityArray(); setPresentValue(new Real(16), 16); getPresentValue(); getPriorityArray(); setPresentValue(new Real(10), 10); getPresentValue(); getPriorityArray(); setPresentValue(new Null(), 10); getPresentValue(); getPriorityArray(); setPresentValue(new Null(), 15); getPresentValue(); getPriorityArray(); setPresentValue(new Null(), 16); getPresentValue(); getPriorityArray(); } localDevice.terminate(); } private static void getPresentValue() throws Exception { ReadPropertyRequest rpr = new ReadPropertyRequest(remoteObject.getObjectIdentifier(), PropertyIdentifier.presentValue); ReadPropertyAck ack = (ReadPropertyAck) localDevice.send(remoteDevice, rpr); System.out.println("Present value: " + ack.getValue()); } private static void getPriorityArray() throws Exception { ReadPropertyRequest rpr = new ReadPropertyRequest(remoteObject.getObjectIdentifier(), PropertyIdentifier.priorityArray); ReadPropertyAck ack = (ReadPropertyAck) localDevice.send(remoteDevice, rpr); System.out.println("Priority array: " + ack.getValue()); } private static void setPresentValue(Encodable value, int priority) throws Exception { WritePropertyRequest wpr = new WritePropertyRequest(remoteObject.getObjectIdentifier(), PropertyIdentifier.presentValue, null, value, new UnsignedInteger(priority)); localDevice.send(remoteDevice, wpr); } }
  • Looking up and determining what AmbiguousValue is

    6
    0 Votes
    6 Posts
    4k Views
    J
    I've written a function which could be used in conjuction with the convertTo(Class<T>) function to get the Object in its correct form for any Primitive class With it, you could then do the following: AmbiguousValue av = (AmbiguousValue)schedule.getProperty(PropertyIdentifier.scheduleDefault); Class<? extends Primitive> c = (Class<? extends Primitive>)av.getPrimitiveClass(); Primitive pr = av.convertTo(c); What is your preferred way for code submissions? A diff file as an attachment or pasted directly into the body in a code block? Or other? Attachment: download link
  • Serialization for APDU classes

    4
    0 Votes
    4 Posts
    4k Views
    J
    :D
  • Bug when sending segmented messages

    2
    0 Votes
    2 Posts
    3k Views
    R
    if (segmentsRequired > request.getMaxSegmentsAccepted() || segmentsRequired > 128) throw new BACnetException("Response too big to send to device; too many segments required:" + segmentsRequired + ", accepted: " + request.getMaxSegmentsAccepted()); above the code to determine the amount of acceptable segment messages. the implementation for getMaxSegmentsAccepted is wrong. it is defined as a bitmap. so we should change that piece of code to: public int getMaxSegmentsAccepted() { switch (maxSegmentsAccepted) { case 0: return 64; case 1: return 2; case 2: return 4; case 3: return 8; case 4: return 16; case 5: return 32; case 6: return 64; case 7: return 128; } // 3 bits - we can't get here return 64; } this is in the class ConfirmedRequest. regards robert
  • BACnet object properties

    3
    0 Votes
    3 Posts
    4k Views
    M
    Currently no. But this is an enhancement that is being considered for M2M2
  • ReadPropertyMultipleRequest

    3
    0 Votes
    3 Posts
    4k Views
    M
    The second piece of code is ok, but where should the first go?
  • Statefull handling of the property services supported

    3
    0 Votes
    3 Posts
    4k Views
    M
    Hi Robert, This is all fine. There were a couple checks that weren't quite right, (e.g. SubscribeCOVRequest), but i think i found them all. Also, regarding confirmed requests i implemented in a way that i hope will work for you. Changes have been checked in.
  • Remote BACnet objects

    3
    0 Votes
    3 Posts
    4k Views
    M
    The BACnet object class is meant to represent local objects, so it may not be exactly what you want. The remote object class is, as you said, more what you are after, but it is only meant to be a proxy of the real object in the remote device. The problem with storing properties in the remote object is that they can easily become stale if the real remote object changes. If you really want to store remote properties locally (some kind of caching that i assume you will refresh as necessary), you'll be best to create your own class.
  • BBMD and Foreign Devices

    3
    0 Votes
    3 Posts
    4k Views
    M
    BACnet4J does not currently support BBMD.
  • A small bug in the atomicwritefilerequest

    8
    0 Votes
    8 Posts
    5k Views
    M
    Ok. I recall (but at the moment can't confirm) that there was some problem with this during testing of the original implementation, but i'll go with your version.
  • Correct destination network behaviour

    3
    0 Votes
    3 Posts
    3k Views
    M
    Looks fine to me. I checked in changes that reflect your code.