<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Quick-Test Programm]]></title><description><![CDATA[<p dir="auto">Hello,</p>
<p dir="auto">i'am new to bacnet4j. I try since a few day to run the little test-programm but with no suggest.</p>
<p dir="auto">My hardware is a wago 750-830 bacnet-controller. when i run the programm with the following line i got an error like this.</p>
<h2>the test-programm</h2>
<p dir="auto">/*<br />
Copyright (C) 2006-2009 Serotonin Software Technologies Inc.<br />
@author Matthew Lohbihler<br />
*/<br />
package testing;<br />
import com.serotonin.bacnet4j.LocalDevice;<br />
import com.serotonin.bacnet4j.RemoteDevice;<br />
import com.serotonin.bacnet4j.service.unconfirmed.WhoIsRequest;<br />
import com.serotonin.bacnet4j.type.constructed.ObjectPropertyReference;<br />
import com.serotonin.bacnet4j.type.enumerated.ObjectType;<br />
import com.serotonin.bacnet4j.type.enumerated.PropertyIdentifier;<br />
import com.serotonin.bacnet4j.type.primitive.ObjectIdentifier;<br />
import com.serotonin.bacnet4j.util.PropertyReferences;<br />
import com.serotonin.bacnet4j.util.PropertyValues;</p>
<p dir="auto">/**</p>
<ul>
<li>
<p dir="auto">@author Matthew Lohbihler<br />
*/<br />
public class QuickTest {<br />
public static void main(String[] args) throws Exception {<br />
LocalDevice localDevice = new LocalDevice(1, "255.255.255.255","localhost");<br />
try {<br />
localDevice.initialize();<br />
localDevice.sendBroadcast(47808, new WhoIsRequest(null,null));</p>
<pre><code>     Thread.sleep(5000);
     
     RemoteDevice d = localDevice.getRemoteDevices().get(0);
     
     ObjectIdentifier oid = new ObjectIdentifier(ObjectType.multiStateOutput, 0);
     for (int i=8; i&amp;lt9; i++) {
         PropertyReferences refs = new PropertyReferences();
         refs.add(oid, new PropertyIdentifier(i));
     
         PropertyValues pvs = localDevice.readProperties(d, refs);
         for (ObjectPropertyReference opr : pvs)
             System.out.println(&amp;quot;&amp;quot;+ i +&amp;quot;: &amp;quot;+ pvs.getNoErrorCheck(opr));
     }
     Thread.sleep(2000);
 }
 finally {
     localDevice.terminate();
 }
</code></pre>
<p dir="auto">}<br />
}</p>
</li>
</ul>
<hr />
<p dir="auto">LocalDevice localDevice = new LocalDevice(1, "255.255.255.255");</p>
<p dir="auto">Exception in thread "main" java.net.BindException: Address already in use: Cannot bind<br />
at java.net.PlainDatagramSocketImpl.bind0(Native Method)<br />
at java.net.PlainDatagramSocketImpl.bind(Unknown Source)<br />
at java.net.DatagramSocket.bind(Unknown Source)<br />
at java.net.DatagramSocket.&lt;init&gt;(Unknown Source)<br />
at java.net.DatagramSocket.&lt;init&gt;(Unknown Source)<br />
at com.serotonin.bacnet4j.npdu.ip.IpMessageControl.initialize(IpMessageControl.java:147)<br />
at com.serotonin.bacnet4j.LocalDevice.initialize(LocalDevice.java:220)<br />
at testing.QuickTest.main(QuickTest.java:23)</p>
<p dir="auto">when i run the code with the following line:</p>
<p dir="auto">LocalDevice localDevice = new LocalDevice(1, "255.255.255.255","localhost");</p>
<p dir="auto">i got the following error:</p>
<p dir="auto">Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 0<br />
at java.util.concurrent.CopyOnWriteArrayList.get(Unknown Source)<br />
at testing.QuickTest.main(QuickTest.java:28)</p>
<p dir="auto">But in whireshark i see, that the bacnet-controller is sending something, everytime i start the programm.</p>
<p dir="auto">(i work on windows xp) what do i wrong?</p>
<p dir="auto">No.     Time        Source                Destination           Protocol Info<br />
10 3.005765    192.168.83.88         192.168.83.255        BACnet-APDU Unconfirmed-Request : i-Am</p>
<p dir="auto">Frame 10 (66 bytes on wire, 66 bytes captured)<br />
Arrival Time: Mar  1, 2010 17:44:20.476889000<br />
[Time delta from previous captured frame: 0.011106000 seconds]<br />
[Time delta from previous displayed frame: 3.005765000 seconds]<br />
[Time since reference or first frame: 3.005765000 seconds]<br />
Frame Number: 10<br />
Frame Length: 66 bytes<br />
Capture Length: 66 bytes<br />
[Frame is marked: True]<br />
[Protocols in frame: eth:ip:udp:bvlc:bacnet:bacapp:data]</p>
<p dir="auto">Ethernet II, Src: WagoKont_03:82:c6 (00:30:de:03:82:c6), Dst: Broadcast (ff:ff:ff:ff:ff:ff)<br />
Destination: Broadcast (ff:ff:ff:ff:ff:ff)<br />
Address: Broadcast (ff:ff:ff:ff:ff:ff)<br />
.... ...1 .... .... .... .... = IG bit: Group address (multicast/broadcast)<br />
.... ..1. .... .... .... .... = LG bit: Locally administered address (this is NOT the factory default)<br />
Source: WagoKont_03:82:c6 (00:30:de:03:82:c6)<br />
Address: WagoKont_03:82:c6 (00:30:de:03:82:c6)<br />
.... ...0 .... .... .... .... = IG bit: Individual address (unicast)<br />
.... ..0. .... .... .... .... = LG bit: Globally unique address (factory default)<br />
Type: IP (0x0800)<br />
Internet Protocol, Src: 192.168.83.88 (192.168.83.88), Dst: 192.168.83.255 (192.168.83.255)<br />
Version: 4<br />
Header length: 20 bytes<br />
Differentiated Services Field: 0x00 (DSCP 0x00: Default; ECN: 0x00)<br />
0000 00.. = Differentiated Services Codepoint: Default (0x00)<br />
.... ..0. = ECN-Capable Transport (ECT): 0<br />
.... ...0 = ECN-CE: 0<br />
Total Length: 52<br />
Identification: 0x3f57 (16215)<br />
Flags: 0x00<br />
0.. = Reserved bit: Not Set<br />
.0. = Don't fragment: Not Set<br />
..0 = More fragments: Not Set<br />
Fragment offset: 0<br />
Time to live: 64<br />
Protocol: UDP (0x11)<br />
Header checksum: 0x12ba [correct]<br />
[Good: True]<br />
[Bad : False]<br />
Source: 192.168.83.88 (192.168.83.88)<br />
Destination: 192.168.83.255 (192.168.83.255)<br />
User Datagram Protocol, Src Port: bacnet (47808), Dst Port: bacnet (47808)<br />
Source port: bacnet (47808)<br />
Destination port: bacnet (47808)<br />
Length: 32<br />
Checksum: 0x8bdb [validation disabled]<br />
[Good Checksum: False]<br />
[Bad Checksum: False]<br />
BACnet Virtual Link Control<br />
Type: BACnet/IP (Annex J) (0x81)<br />
Function: Original-Broadcast-NPDU (0x0b)<br />
BVLC-Length: 4 of 24 bytes BACnet packet length<br />
Building Automation and Control Network NPDU<br />
Version: 0x01 (ASHRAE 135-1995)<br />
Control: 0x20<br />
0... .... = NSDU contains: BACnet APDU, message type field absent.<br />
.0.. .... = Reserved: Shall be zero and is zero.<br />
..1. .... = Destination Specifier: DNET, DLEN and Hop Count present. If DLEN=0: broadcast, dest. address field absent.<br />
...0 .... = Reserved: Shall be zero and is zero.<br />
.... 0... = Source specifier: SNET, SLEN and SADR absent<br />
.... .0.. = Expecting Reply: Other than a BACnet-Confirmed-Request-PDU, segment of BACnet-ComplexACK-PDU or network layer message expecting a reply present.<br />
.... ..0. = Priority: Not a Life Safety or Critical Equipment message.<br />
.... ...0 = Priority: Normal message<br />
Destination Network Address: 65535<br />
Destination MAC Layer Address Length: 0 indicates Broadcast on Destination Network<br />
Hop Count: 255<br />
Building Automation and Control Network APDU<br />
0001 .... = APDU Type: Unconfirmed-Request  (1)<br />
Unconfirmed Service Choice: i-Am (0)<br />
ObjectIdentifier: device object, 230086<br />
Application Tag: BACnetObjectIdentifier, Length/Value/Type: 4<br />
.... 0... = Tag Class: Application Tag<br />
1100 .... = Application Tag Number: BACnetObjectIdentifier (12)<br />
Length Value Type: 4<br />
0000 0010 00.. .... .... .... .... .... = Object Type: device object (8)<br />
.... .... ..00 0011 1000 0010 1100 0110 = Instance Number: 230086<br />
Maximum ADPU Length Accepted: (Unsigned) 480<br />
Application Tag: Unsigned Integer, Length/Value/Type: 2<br />
.... 0... = Tag Class: Application Tag<br />
0010 .... = Application Tag Number: Unsigned Integer (2)<br />
Length Value Type: 2<br />
Segmentation Supported:  segmented-both<br />
Application Tag: Enumerated, Length/Value/Type: 1<br />
.... 0... = Tag Class: Application Tag<br />
1001 .... = Application Tag Number: Enumerated (9)<br />
Length Value Type: 1<br />
Vendor ID: WAGO Kontakttechnik GmbH &amp; Co. KG (222)<br />
Application Tag: Unsigned Integer, Length/Value/Type: 1<br />
.... 0... = Tag Class: Application Tag<br />
0010 .... = Application Tag Number: Unsigned Integer (2)<br />
Length Value Type: 1<br />
Vendor Identifier: WAGO Kontakttechnik GmbH &amp; Co. KG (222)</p>
]]></description><link>https://forum.mango-os.com/topic/311/quick-test-programm</link><generator>RSS for Node</generator><lastBuildDate>Mon, 13 Apr 2026 12:07:23 GMT</lastBuildDate><atom:link href="https://forum.mango-os.com/topic/311.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 01 Mar 2010 17:06:45 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Quick-Test Programm on Thu, 04 Mar 2010 15:15:51 GMT]]></title><description><![CDATA[<p dir="auto">I'm not sure what this test program was intended for, but it has revealed an odd condition. The property identifiers "all", "required" and "optional" are special in that they refer to multiple properties rather than one. As such, a ReadProperty request cannot be used to retrieve them since the response can only contain a single property.</p>
<p dir="auto">But, the LocalDevice.readProperties method detects when a single property identifier was provided, and uses a ReadProperty request for efficiency. I will enhance the method to detect these properties. In the meantime, you can explicitly use a ReadPropertyMultiple request to retrieve "all" object properties.</p>
]]></description><link>https://forum.mango-os.com/post/3321</link><guid isPermaLink="true">https://forum.mango-os.com/post/3321</guid><dc:creator><![CDATA[mlohbihler]]></dc:creator><pubDate>Thu, 04 Mar 2010 15:15:51 GMT</pubDate></item><item><title><![CDATA[Reply to Quick-Test Programm on Wed, 03 Mar 2010 05:37:51 GMT]]></title><description><![CDATA[<p dir="auto">Hello,</p>
<p dir="auto">now with this code i get the following response:</p>
<pre><code>
ObjectIdentifier oid = new ObjectIdentifier(ObjectType.multiStateValue, 0);
            for (int i=1; i&lt;2; i++) {
                PropertyReferences refs = new PropertyReferences();
                refs.add(oid, new PropertyIdentifier(79));
            
                PropertyValues pvs = localDevice.readProperties(d, refs);
                for (ObjectPropertyReference opr : pvs){
                    System.out.println(""+ i +": "+ pvs.getNoErrorCheck(opr));
                }
            }

</code></pre>
<pre><code>
1: Multi-state Value

</code></pre>
<p dir="auto">The objectidentifier was wrong.</p>
<p dir="auto">But with this code</p>
<pre><code>
  ObjectIdentifier oid = new ObjectIdentifier(ObjectType.multiStateValue, 0);
            for (int i=1; i&lt;2; i++) {
                PropertyReferences refs = new PropertyReferences();
                refs.add(oid, PropertyIdentifier.all);
            
                PropertyValues pvs = localDevice.readProperties(d, refs);
                for (ObjectPropertyReference opr : pvs){
                    System.out.println(opr.getPropertyIdentifier() +" "+ i +": "+ pvs.getNoErrorCheck(opr));
                }
            }

</code></pre>
<p dir="auto">i got this error message:</p>
<pre><code>
All 1: errorClass=Property, errorCode=Unknown property

</code></pre>
<p dir="auto">How can i read now the object-properties from the multi-state-value?</p>
<p dir="auto">Thanks for help</p>
]]></description><link>https://forum.mango-os.com/post/3308</link><guid isPermaLink="true">https://forum.mango-os.com/post/3308</guid><dc:creator><![CDATA[dufy]]></dc:creator><pubDate>Wed, 03 Mar 2010 05:37:51 GMT</pubDate></item><item><title><![CDATA[Reply to Quick-Test Programm on Tue, 02 Mar 2010 14:47:56 GMT]]></title><description><![CDATA[<p dir="auto">It looks like the oid that you specified was not found. Are you sure you have a multistate output with an id of 0? You can request an object list to find out.</p>
<p dir="auto">Also, your code would read a bit more easily of written like this:</p>
<pre><code>            ObjectIdentifier oid = new ObjectIdentifier(ObjectType.multiStateOutput, 0);
            PropertyReferences refs = new PropertyReferences();
            refs.add(oid, PropertyIdentifier.all);
                
            PropertyValues pvs = localDevice.readProperties(d, refs);
            for (ObjectPropertyReference opr : pvs)
                System.out.println(""+ opr.getPropertyIdentifier() +": "+ pvs.getNoErrorCheck(opr));

</code></pre>
]]></description><link>https://forum.mango-os.com/post/3303</link><guid isPermaLink="true">https://forum.mango-os.com/post/3303</guid><dc:creator><![CDATA[mlohbihler]]></dc:creator><pubDate>Tue, 02 Mar 2010 14:47:56 GMT</pubDate></item><item><title><![CDATA[Reply to Quick-Test Programm on Tue, 02 Mar 2010 06:47:42 GMT]]></title><description><![CDATA[<p dir="auto">Hello,</p>
<p dir="auto">now i have deinstall the wago-bacnet driver and start the programm after a new boot. i think it works. No errors.<br />
Now i get this output:</p>
<p dir="auto">8: errorClass=Object, errorCode=Unknown object</p>
<p dir="auto">what does it mean exactly?</p>
<p dir="auto">thank for help:</p>
]]></description><link>https://forum.mango-os.com/post/3301</link><guid isPermaLink="true">https://forum.mango-os.com/post/3301</guid><dc:creator><![CDATA[dufy]]></dc:creator><pubDate>Tue, 02 Mar 2010 06:47:42 GMT</pubDate></item><item><title><![CDATA[Reply to Quick-Test Programm on Mon, 01 Mar 2010 17:31:20 GMT]]></title><description><![CDATA[<p dir="auto">You are getting the first error (cannot bind) because the port you are trying to bind to (0xBAC0 by default) is already in use. This is probably because a previous test that you ran is still running and using the port. Make sure all test programs are terminated before running again.</p>
<p dir="auto">The second error is because of this line (line 28, as the stack trace says):</p>
<pre><code>RemoteDevice d = localDevice.getRemoteDevices().get(0); 
</code></pre>
<p dir="auto">You are asking for element 0, which apparently doesn't exist.</p>
]]></description><link>https://forum.mango-os.com/post/3295</link><guid isPermaLink="true">https://forum.mango-os.com/post/3295</guid><dc:creator><![CDATA[mlohbihler]]></dc:creator><pubDate>Mon, 01 Mar 2010 17:31:20 GMT</pubDate></item></channel></rss>