Getting an Object List and Values
-
Hopefully this is a quick fix and I'm just missing something really obvious. I'm using some of the sample code in the test files and getting time outs while trying to get data. Code is below.
I have tried different values for the OID. When I try "0" it comes back immediately as null which is accurate. The spec sheet is saying AV1-AV145 and BV1-BV36 is valid.
ObjectIdentifier oidtest = new ObjectIdentifier(ObjectType.analogValue, 3); PropertyReferences refstest = new PropertyReferences(); refstest.add(oidtest, PropertyIdentifier.all); PropertyValues pvstest = localDevice.readProperties(d, refstest); for (ObjectPropertyReference opr : pvstest) System.out.println(pvstest.getNoErrorCheck(opr));
Second issue is on the object list.
I have tried the code below. It doesn't work on my device because it doens't support segmentation. Are there some other functions that I could replace here?
List<ObjectIdentifier> oids = ((SequenceOf<ObjectIdentifier>) localDevice.sendReadPropertyAllowNull(d, d.getObjectIdentifier(), PropertyIdentifier.objectList)).getValues();
Thanks
-
For the first issue, i suggest trying a different property than "all", such as "presentValue". It might be that the response for all properties is too big, and the equipments doesn't bother responding or something.
BACnet4J has quite robust code for handling equipment with severe limitations. When a request is made for, say, all properties, the fastest way to get the data is first attempted. If this fails, it then tries subsequently slower more generally more supported means. Finally, it might resort to asking for individual properties or even individual sequence elements.
This all depends upon the equipment responding properly to failures though. If your devices simply don't respond to requests they don't like, that's not very helpful.
-
Thank you very much, that solved it.
I still would like to get a list of object from the device if anyone has any ideas on that. At least not I'm getting data though so that is 95% of the way there. :)
-
Too easy. If you can't just ask for the object list (see LocalDevice.sendReadPropertyAllowNull), you can always ask for the length of the object list (element 0), and then individually request each element.