• Recent
    • Tags
    • Popular
    • Register
    • Login
    1. Home
    2. Valter Henrique
    3. Topics

    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
    V
    • Profile
    • Following 0
    • Followers 0
    • Topics 8
    • Posts 38
    • Best 1
    • Controversial 0
    • Groups 0

    Topics created by Valter Henrique

    • V

      Not understand how to know the objectType value

      BACnet4J general discussion
      • • • Valter Henrique
      8
      0
      Votes
      8
      Posts
      4.0k
      Views

      V

      @mlohbihler said:

      Use read property requests with the present value property identifier.

      I did as you said :

      public String getPresentValue(LocalDevice localDevice, ObjectIdentifier oid) throws Exception { ReadPropertyRequest rpr = new ReadPropertyRequest(oid, PropertyIdentifier.presentValue); ReadPropertyAck rpa = (ReadPropertyAck) localDevice.send(isa, null, 1476, Segmentation.segmentedReceive, rpr); SequenceOf<ObjectIdentifier> sOis = (SequenceOf<ObjectIdentifier>) rpa.getValue(); List<ObjectIdentifier> ois = new ArrayList<ObjectIdentifier>(); for (ObjectIdentifier oi : sOis) { System.out.println("--> " + oi.getObjectType().intValue()); } return rpa.getValue().toString(); }

      But it gives this follow error:

      java.lang.ClassCastException: com.serotonin.bacnet4j.type.primitive.Real cannot be cast to com.serotonin.bacnet4j.type.constructed.SequenceOf at brainset.bacnet4j.Supervisory.getPresentValue(Supervisory.java:123)

      What I'm trying to do is scan my device and know what kind of points I have, if is a analog output, analog input, etc.
      And store these points values in my List<...>.

    • V

      How communicate to a remote device ?

      BACnet4J general discussion
      • • • Valter Henrique
      10
      0
      Votes
      10
      Posts
      5.2k
      Views

      V

      In the end I created a server (which runs in the computer that's locally placed in my network) and then communicate via socket.

      Until I found out how implement a RemoteDevice that you said, thanks mlohbihler.

    • V

      Encodable not found ?

      BACnet4J general discussion
      • • • Valter Henrique
      5
      0
      Votes
      5
      Posts
      2.7k
      Views

      M

      Thanks very much Valter.

    • V

      How to know the type of the object ?

      BACnet4J general discussion
      • • • Valter Henrique
      4
      0
      Votes
      4
      Posts
      3.4k
      Views

      V

      sorry taking so long to reply friend. (I was involved in another project, but now returning to bacnet4j )

      I try what you suggest but it just told me the value of the binary and the analog, which is :

      Object type || value
      Device : 8
      Analog Value : 2
      Binary Value : 5

      What I need is a little more specific, how to know the int value of a binary input for example ?

    • V

      How read and write values from local devices ?

      BACnet4J general discussion
      • • • Valter Henrique
      11
      0
      Votes
      11
      Posts
      8.0k
      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

      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.

    • V

      ArrayIndexOutOfBoundsException in CommandPriorityTest

      BACnet4J general discussion
      • • • Valter Henrique
      5
      0
      Votes
      5
      Posts
      3.8k
      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); } }
    • V

      How get/set value from my device ?

      BACnet4J general discussion
      • • • Valter Henrique
      11
      0
      Votes
      11
      Posts
      7.2k
      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..

    • V

      BACNet and Web Services

      BACnet4J general discussion
      • • • Valter Henrique
      3
      0
      Votes
      3
      Posts
      2.7k
      Views

      M

      Serotonin has done multiple projects building access to specific devices, including various models of the FX. Web services are a relatively straightforward way of exchanging information. I recommend using M2M2 so that a specific data source module can be built for your purposes.