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

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

    Valter Henrique

    @Valter Henrique

    1
    Reputation
    773
    Profile views
    38
    Posts
    0
    Followers
    0
    Following
    Joined Last Online

    Valter Henrique Unfollow Follow

    Best posts made by Valter Henrique

    • RE: How read and write values from local devices ?

      Hi everyone,
      i finally found it what was my mistake, so i replace by this and works fine!

      
                  if (i == 4){
                      for (int k = 1; k <=16; k++){
                          setPresentValue(addr, read, oid, new com.serotonin.bacnet4j.type.primitive.Boolean(true) , k); // alternate between true and false input
                      }
                  }
      
      

      Thank you Serotonin by this great project, really thanks!

      posted in BACnet4J general discussion
      V
      Valter Henrique

    Latest posts made by Valter Henrique

    • RE: Not understand how to know the objectType value

      @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&lt;ObjectIdentifier&gt; sOis = (SequenceOf&lt;ObjectIdentifier&gt;) rpa.getValue();
      
              List&lt;ObjectIdentifier&gt; ois = new ArrayList&lt;ObjectIdentifier&gt;();
              for (ObjectIdentifier oi : sOis) {
                  System.out.println(&quot;--&gt; &quot; + 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<...>.

      posted in BACnet4J general discussion
      V
      Valter Henrique
    • RE: Not understand how to know the objectType value

      @mlohbihler said:

      Valter,

      You are incorrect in thinking that an analog can only be an input or an output. There are three possible analog types: input, output, and value. Your object is a value.
      Ow, got it mlohbihler.

      There's some way to get the values from the input and output objects ?

      This is how I'm doing to get these values :

          private List&lt;ObjectIdentifier&gt; getListObjectIdentifier(LocalDevice localDevice) throws Exception {
              ReadPropertyRequest rpr = new ReadPropertyRequest(new ObjectIdentifier(ObjectType.device, deviceID), PropertyIdentifier.objectList);
              ReadPropertyAck rpa = (ReadPropertyAck) localDevice.send(isa, null, 1476, Segmentation.segmentedBoth, rpr);
      
              SequenceOf&lt;ObjectIdentifier&gt; sOis = (SequenceOf&lt;ObjectIdentifier&gt;) rpa.getValue();
      
              List&lt;ObjectIdentifier&gt; ois = new ArrayList&lt;ObjectIdentifier&gt;();
              for (ObjectIdentifier oi : sOis) {
                  ois.add(oi);
              }
      
              return ois;
          }
      
      
      posted in BACnet4J general discussion
      V
      Valter Henrique
    • RE: Not understand how to know the objectType value

      @mlohbihler said:

      That object, "oi", is not an "output" or an "input"; it is a "value", which is a valid third type of bacnet input. "Value"s are basically both input and output.
      So, what should I do to get the exact type of the object ?
      I mean, how do I know if is a analog output or analog input ?

      posted in BACnet4J general discussion
      V
      Valter Henrique
    • Not understand how to know the objectType value

      I have some objects that I must to know which is the exactly the value of this object, if it's analog OUTPUT or analog INPUT, got it ?

      For example:
      If you I did this :

                  System.out.println("oi.getObjectType().intValue(): " + oi.getObjectType().intValue());
                  
                  System.out.println("ObjectType.analogOutput.intValue(): " + ObjectType.analogOutput.intValue());
                  System.out.println("ObjectType.analogInput.intValue(): " + ObjectType.analogInput.intValue());
                  System.out.println("ObjectType.analogValue.intValue(): " + ObjectType.analogValue.intValue());
      

      Which the answer gonna be:

      oi.getObjectType().intValue(): 2
      ObjectType.analogOutput.intValue(): 1
      ObjectType.analogInput.intValue(): 0
      ObjectType.analogValue.intValue(): 2
      

      But I need to know if is OUTPUT (1) or INPUT (0).
      How can I do that ?

      posted in BACnet4J general discussion
      V
      Valter Henrique
    • RE: Not understand how to know the objectType value

      I have some objects that I must to know which is the exactly the value of this object, if it's analog OUTPUT or analog INPUT, got it ?

      For example:
      If you I did this :

                  System.out.println("oi.getObjectType().intValue(): " + oi.getObjectType().intValue());
                  
                  System.out.println("ObjectType.analogOutput.intValue(): " + ObjectType.analogOutput.intValue());
                  System.out.println("ObjectType.analogInput.intValue(): " + ObjectType.analogInput.intValue());
                  System.out.println("ObjectType.analogValue.intValue(): " + ObjectType.analogValue.intValue());
      

      Which the answer gonna be:

      oi.getObjectType().intValue(): 2
      ObjectType.analogOutput.intValue(): 1
      ObjectType.analogInput.intValue(): 0
      ObjectType.analogValue.intValue(): 2
      

      But I need to know if is OUTPUT (1) or INPUT (0).
      How can I do that ?

      posted in BACnet4J general discussion
      V
      Valter Henrique
    • RE: How communicate to a remote device ?

      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.

      posted in BACnet4J general discussion
      V
      Valter Henrique
    • RE: How communicate to a remote device ?

      @mlohbihler said:

      I don't think so, but it's not hard. The only trick is that you need to know the instance id of the device.

      RemoteDevice rd = new RemoteDevice(...);
      localDevice.addRemoteDevice(rd); // This may not actually be necessary
      localDevice.send(rd, myRequest);
      

      Where "myRequest" is, say, a read property with pid of objectList. If your setting are correct, you should get the object list of the remote device.

      I found the id of my device, it's 101, but I have some doubts about it :

          public static void main(String[] args) throws Exception {
              // How to initialize the LocalDevice ?
              LocalDevice ld = new LocalDevice (???);
      
              // let's say my ip is : 1.2.3.4, is this correct ?
          	RemoteDevice rd = new RemoteDevice(101, new Address(new byte[] { (byte) 1, (byte) 2, 3, (byte) 4 }, 47808), null);
              ld.addRemoteDevice(rd);
      
              // now I have the remote device, in the localDevice, now I should be able to use the method 'getObjectList()' ?
             
              // how to use this 'myRequest' (I don't understand what you said about it ) ?
              localDevice.send(rd, myRequest);
              ...
      }
      
      
      posted in BACnet4J general discussion
      V
      Valter Henrique
    • RE: How communicate to a remote device ?

      @mlohbihler said:

      Hi Valter,

      What do you mean by remote? I suspect you mean a device with which you cannot exchange a WhoIs/IAm, but please confirm.

      If this is the case, you will need to manually instantiate a RemoteDevice by explicitly providing the IP, port, and instance id. Then, you will be able to send messages to it.

      Regarding using a domain name, BACnet only deals with IP addresses, so you will need to handle domain name resolution yourself.

      I mean, a device that is not in my network.
      There's some example in the test folder that could use for that ?

      posted in BACnet4J general discussion
      V
      Valter Henrique
    • RE: How to get the objects in the remote device?

      Pine,
      I'm trying to read value using bacnet4j too.

      Could you please tell which code do you use to do that ?
      I did this locally, but not remotely.

      Thank you very much.

      posted in BACnet4J general discussion
      V
      Valter Henrique
    • RE: Constructor for Network and RemoteDevice

      @drubin said:

      There are many lost souls out there with this basic question. Can someone please answer?
      Drubin, there's some place where we could find some documentation about bacnet4j ?

      posted in BACnet4J general discussion
      V
      Valter Henrique