<?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[Modbus4J general discussion]]></title><description><![CDATA[Whatever you want to know about this package.]]></description><link>https://forum.mango-os.com/category/11</link><generator>RSS for Node</generator><lastBuildDate>Sat, 11 Apr 2026 15:25:25 GMT</lastBuildDate><atom:link href="https://forum.mango-os.com/category/11.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 03 Jan 2023 09:26:48 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[How do I set the value of slave to auto increase?]]></title><link>https://forum.mango-os.com/topic/5604/how-do-i-set-the-value-of-slave-to-auto-increase</link><guid isPermaLink="true">https://forum.mango-os.com/topic/5604/how-do-i-set-the-value-of-slave-to-auto-increase</guid><pubDate>Tue, 03 Jan 2023 09:26:48 GMT</pubDate></item><item><title><![CDATA[Problem with library repository]]></title><link>https://forum.mango-os.com/topic/5488/problem-with-library-repository</link><guid isPermaLink="true">https://forum.mango-os.com/topic/5488/problem-with-library-repository</guid><pubDate>Fri, 04 Mar 2022 17:13:57 GMT</pubDate></item><item><title><![CDATA[Help understanding addresses (offsets)]]></title><description><![CDATA[@terrypacker
NOW I understand! The offset is determined using predefined starting addresses by function from the MODBUS specification! Your explanation and that website you pointed me to was far more informative than watching a bunch of YouTube videos! Thank you so much for you help!
For those who find this thread later in life, here is what works (as of CLICK firmware 3.21):
  public static void main( String[] args ) throws Exception
  {
    /* Define Connection */
    IpParameters ipParameters = new IpParameters();
    ipParameters.setHost( "10.3.17.132" );
    ipParameters.setPort( 502 );

    /* Make the connection */
    ModbusMaster master = new ModbusFactory().createTcpMaster( ipParameters, false );
    master.init();

    /* Test connectivity */
    System.out.println( "testSlaveNode 1: " + master.testSlaveNode( 1 ) );

    /* Define the location points and type */
    BaseLocator&lt; Boolean &gt; clickX001 = BaseLocator.inputStatus( 1, 0 ); // Click X001: input BIT on CPU
    BaseLocator&lt; Boolean &gt; clickY001 = BaseLocator.coilStatus( 1, 0 ); // Click Y001: output COIL on CPU
    BaseLocator&lt; Boolean &gt; clickY002 = BaseLocator.coilStatus( 1, 1 ); // Click Y002: output COIL on CPU
    BaseLocator&lt; Number &gt; clickDS1 = BaseLocator.holdingRegister( 1, 0, DataType.TWO_BYTE_INT_SIGNED ); // Click DS1: Data Register Single Word

    /* Set/Write a value to a point */
    master.setValue( clickDS1, 1 );

    /* Get/Read the current value of each point */
    System.out.println( "clickX001  : " + master.getValue( clickX001 ) );
    System.out.println( "clickY001  : " + master.getValue( clickY001 ) );
    System.out.println( "clickY002  : " + master.getValue( clickY002 ) );
    System.out.println( "clickDS1   : " + master.getValue( clickDS1 ) );
  }

PLC Program for testing:
[image: x5Rhsqu.png]
]]></description><link>https://forum.mango-os.com/topic/5485/help-understanding-addresses-offsets</link><guid isPermaLink="true">https://forum.mango-os.com/topic/5485/help-understanding-addresses-offsets</guid><dc:creator><![CDATA[VanJr]]></dc:creator><pubDate>Wed, 23 Feb 2022 23:47:40 GMT</pubDate></item><item><title><![CDATA[Feedback on Modbus4j]]></title><description><![CDATA[Mango uses Modbus4J in 1000's of applications around the world.  It is a well used and full-featured library.  You won't see much development activity on it since it has been very stable for a long time.
]]></description><link>https://forum.mango-os.com/topic/4817/feedback-on-modbus4j</link><guid isPermaLink="true">https://forum.mango-os.com/topic/4817/feedback-on-modbus4j</guid><dc:creator><![CDATA[JoelHaggar]]></dc:creator><pubDate>Thu, 28 May 2020 12:54:57 GMT</pubDate></item><item><title><![CDATA[Modbus identifying serial ports]]></title><description><![CDATA[Hi vijay,
There may be more than one solution, but we have solved this on our MangoES product for instance by using udev rules to create a symlink with a consistent name. In our case, we used the attributes identifying which USB port the device was connected to. You may find this stack exchange thread helpful: https://unix.stackexchange.com/questions/66901/how-to-bind-usb-device-under-a-static-name
You'll need to use udevadm to find the attributes to identify the port by, and then a /etc/udev/rules.d/ rule to SYMLINK+="ttyNewSymlinkName"
]]></description><link>https://forum.mango-os.com/topic/4330/modbus-identifying-serial-ports</link><guid isPermaLink="true">https://forum.mango-os.com/topic/4330/modbus-identifying-serial-ports</guid><dc:creator><![CDATA[phildunlap]]></dc:creator><pubDate>Tue, 23 Jul 2019 04:44:28 GMT</pubDate></item><item><title><![CDATA[MODBUS RTU discovery.]]></title><description><![CDATA[Modbus does not provide a built-in way of detecting slaves.  So to do what you want to do would need to be a hack or workaround...Such as polling each slave, if there is a response from that slaveId even if it is an error code such as "illegal address", then there is probably a slave of that ID ??
]]></description><link>https://forum.mango-os.com/topic/4247/modbus-rtu-discovery</link><guid isPermaLink="true">https://forum.mango-os.com/topic/4247/modbus-rtu-discovery</guid><dc:creator><![CDATA[CraigWeb]]></dc:creator><pubDate>Tue, 11 Jun 2019 11:54:22 GMT</pubDate></item><item><title><![CDATA[Modbus4J throwing error.]]></title><description><![CDATA[The most proactive thing you could do for the issue of the null pointer is perhaps to fork the repository, implement some tests that use input and output streams, finish the TestSerialPortWrapper class, and submit a pull request.
But, if you're trying to talk to an actual device and not simply playing with the test code, then perhaps you are wanting to use your own implementing class of SerialPortWrapper which presents the input and output streams of your serial port in the methods that return null in the test class.
In Mango, our Modbus module makes a call to the SerialPortManager to get a proxy, and then returns the input stream and output stream from the proxy.
https://github.com/infiniteautomation/ma-core-public/blob/main/Core/src/com/infiniteautomation/mango/io/serial/SerialPortManagerImpl.java#L205
returns
https://github.com/infiniteautomation/ma-core-public/blob/main/Core/src/com/infiniteautomation/mango/io/serial/JsscSerialPortProxy.java
for non-virtual serial ports in Mango, which uses Jssc to actually handle the serial nitty-gritty.
]]></description><link>https://forum.mango-os.com/topic/4232/modbus4j-throwing-error</link><guid isPermaLink="true">https://forum.mango-os.com/topic/4232/modbus4j-throwing-error</guid><dc:creator><![CDATA[phildunlap]]></dc:creator><pubDate>Wed, 29 May 2019 08:34:07 GMT</pubDate></item><item><title><![CDATA[MODBUS JAVA agent for data acquisition]]></title><description><![CDATA[@phildunlap thanks a lot.
]]></description><link>https://forum.mango-os.com/topic/4230/modbus-java-agent-for-data-acquisition</link><guid isPermaLink="true">https://forum.mango-os.com/topic/4230/modbus-java-agent-for-data-acquisition</guid><dc:creator><![CDATA[vijay chelliah]]></dc:creator><pubDate>Tue, 28 May 2019 06:06:25 GMT</pubDate></item><item><title><![CDATA[Modbus4j won&#x27;t talk with InTouch (DASMBTCP)]]></title><description><![CDATA[
I'm sorry for posting without any specific content but i didn't know what will be best.

Understandable, and it can lead people down the wrong paths to focus on the
wrong thing. But assuredly we need something to even stand a chance of offering something back.
I imagine you're adding a BasicProcessImage to a TcpSlave via the addProcessImage function. You should be able to instantiate a com.serotonin.modbus4j.BasicProcessImage with a slave ID of 255.
]]></description><link>https://forum.mango-os.com/topic/3819/modbus4j-won-t-talk-with-intouch-dasmbtcp</link><guid isPermaLink="true">https://forum.mango-os.com/topic/3819/modbus4j-won-t-talk-with-intouch-dasmbtcp</guid><dc:creator><![CDATA[phildunlap]]></dc:creator><pubDate>Fri, 05 Oct 2018 13:10:29 GMT</pubDate></item><item><title><![CDATA[Error Importing Modbus4J Library in Netbeans]]></title><description><![CDATA[Seems like a path issue. Is modbus4j on your classpath?
]]></description><link>https://forum.mango-os.com/topic/3430/error-importing-modbus4j-library-in-netbeans</link><guid isPermaLink="true">https://forum.mango-os.com/topic/3430/error-importing-modbus4j-library-in-netbeans</guid><dc:creator><![CDATA[phildunlap]]></dc:creator><pubDate>Thu, 19 Apr 2018 11:06:13 GMT</pubDate></item><item><title><![CDATA[Try to reading data on the Modbus network from the Altivar frequency converter or MODICON PLC]]></title><description><![CDATA[Hi mischaivchenko,
Three things I would consider trying are,

What happens if you use Mango's tools on the Modbus Data Source page to read these registers? Do you get better feedback, or output to the log file? The point locator test tool uses the same method you are using.
Can you attach a debugger? Modbus4J is open source and as far as gaining knowledge in Java goes, you should be able to attach a debugger in your IDE and step into the code.
Get a log4j configuration that will output the various log statements from TcpMaster and pass that into your program as a command line argument.

]]></description><link>https://forum.mango-os.com/topic/3393/try-to-reading-data-on-the-modbus-network-from-the-altivar-frequency-converter-or-modicon-plc</link><guid isPermaLink="true">https://forum.mango-os.com/topic/3393/try-to-reading-data-on-the-modbus-network-from-the-altivar-frequency-converter-or-modicon-plc</guid><dc:creator><![CDATA[phildunlap]]></dc:creator><pubDate>Sat, 07 Apr 2018 08:03:06 GMT</pubDate></item><item><title><![CDATA[using Modbus4j ,Jumping values while reading value from secure elite 440-447 energy meter]]></title><description><![CDATA[Hi Sagarsama,
So, you're requesting the same register over some period of time, and it never errors but the value is usually what you would expect for the kWh and occasionally what you expect for the instantaneous voltage? That's bizarre. I would set up a Mango reading that register for a while to be sure that is what is going on (you make it sounds as though you are using Modbus4J in your own application), but that sounds like an issue with the PLC. If you're requesting the same range of values and it is spontaneously changing those values, that is its issue.
]]></description><link>https://forum.mango-os.com/topic/3200/using-modbus4j-jumping-values-while-reading-value-from-secure-elite-440-447-energy-meter</link><guid isPermaLink="true">https://forum.mango-os.com/topic/3200/using-modbus4j-jumping-values-while-reading-value-from-secure-elite-440-447-energy-meter</guid><dc:creator><![CDATA[phildunlap]]></dc:creator><pubDate>Wed, 10 Jan 2018 05:38:01 GMT</pubDate></item><item><title><![CDATA[How to import Modbus4J into Android studio?]]></title><description><![CDATA[It should be the same process as any other Java project or regular JAR. I've never used Android studio personally though, so i can't give you specific instruction. I bet "import jar android studio" gets usable search results from elsewhere on the web. The github project is here: https://github.com/infiniteautomation/modbus4j
]]></description><link>https://forum.mango-os.com/topic/3174/how-to-import-modbus4j-into-android-studio</link><guid isPermaLink="true">https://forum.mango-os.com/topic/3174/how-to-import-modbus4j-into-android-studio</guid><dc:creator><![CDATA[phildunlap]]></dc:creator><pubDate>Thu, 28 Dec 2017 14:59:07 GMT</pubDate></item><item><title><![CDATA[How to add Modbus 4j Library to Android studio]]></title><link>https://forum.mango-os.com/topic/3173/how-to-add-modbus-4j-library-to-android-studio</link><guid isPermaLink="true">https://forum.mango-os.com/topic/3173/how-to-add-modbus-4j-library-to-android-studio</guid><pubDate>Thu, 28 Dec 2017 14:56:09 GMT</pubDate></item><item><title><![CDATA[TCP&#x2F;IP MODBUS ANDROID]]></title><description><![CDATA[Hi,Dan! Have you maked the application ? I have the same problem. I am trying to use modbus4j but without success. Sorry for your worrying. Alexander.
]]></description><link>https://forum.mango-os.com/topic/3087/tcp-ip-modbus-android</link><guid isPermaLink="true">https://forum.mango-os.com/topic/3087/tcp-ip-modbus-android</guid><dc:creator><![CDATA[Alexander]]></dc:creator><pubDate>Thu, 16 Nov 2017 10:05:16 GMT</pubDate></item><item><title><![CDATA[Need Help , Error:(23, 31) error: package com.serotonin.messaging does not exist]]></title><link>https://forum.mango-os.com/topic/2990/need-help-error-23-31-error-package-com-serotonin-messaging-does-not-exist</link><guid isPermaLink="true">https://forum.mango-os.com/topic/2990/need-help-error-23-31-error-package-com-serotonin-messaging-does-not-exist</guid><pubDate>Sat, 07 Oct 2017 08:13:18 GMT</pubDate></item><item><title><![CDATA[Need a Modbus polling program using Modbus4J]]></title><description><![CDATA[You can review our main site, then download the Mango files.  Here is an article about exploring the API once you have Mango running on your machine: https://help.infiniteautomation.com/explore-the-api/
We need to update the document on API authentication which you'll need before you integrate your application but you can use Swagger to test all the end points and see the JSON formats
]]></description><link>https://forum.mango-os.com/topic/2742/need-a-modbus-polling-program-using-modbus4j</link><guid isPermaLink="true">https://forum.mango-os.com/topic/2742/need-a-modbus-polling-program-using-modbus4j</guid><dc:creator><![CDATA[JoelHaggar]]></dc:creator><pubDate>Mon, 01 May 2017 22:50:41 GMT</pubDate></item><item><title><![CDATA[Modbus4J - help with getting started]]></title><description><![CDATA[check out the modbus data source in the old mango source code for an example on how to use the modbus4j library
https://sourceforge.net/projects/scadabr/files/Software/mango-src/
]]></description><link>https://forum.mango-os.com/topic/2644/modbus4j-help-with-getting-started</link><guid isPermaLink="true">https://forum.mango-os.com/topic/2644/modbus4j-help-with-getting-started</guid><dc:creator><![CDATA[craig]]></dc:creator><pubDate>Sun, 29 Jan 2017 20:58:51 GMT</pubDate></item><item><title><![CDATA[RTU RS232 communication problem]]></title><description><![CDATA[Hi libu7alex,


ReadSerialTest throws a null pointer because TestSerialPortWrapper returns nulls for its input and output streams. That looks like a bug in the test, and shouldn't affect the larger issue you seem to be asking about, so,


I believe you're writing code to use Modbus4J? We offer limited free support for this.


You are providing the SerialPortWrapper to the Modbus master you're creating an instance of, correct? If so you should set a breakpoint in your serial port wrapper and see what happens in the serial library you're wrapping for the 232 setup you're testing when it tries to get the input or output stream from your wrapper.


]]></description><link>https://forum.mango-os.com/topic/2637/rtu-rs232-communication-problem</link><guid isPermaLink="true">https://forum.mango-os.com/topic/2637/rtu-rs232-communication-problem</guid><dc:creator><![CDATA[phildunlap]]></dc:creator><pubDate>Sat, 21 Jan 2017 17:31:56 GMT</pubDate></item><item><title><![CDATA[How to cast BatchResults getValue(n) property to int in ModBus TCP&#x2F;IP]]></title><description><![CDATA[Thank you so much it works.
]]></description><link>https://forum.mango-os.com/topic/2574/how-to-cast-batchresults-getvalue-n-property-to-int-in-modbus-tcp-ip</link><guid isPermaLink="true">https://forum.mango-os.com/topic/2574/how-to-cast-batchresults-getvalue-n-property-to-int-in-modbus-tcp-ip</guid><dc:creator><![CDATA[libu7alex]]></dc:creator><pubDate>Thu, 01 Dec 2016 20:42:44 GMT</pubDate></item><item><title><![CDATA[Mod10K]]></title><description><![CDATA[We have added Mod10k data types into the next release of the Modbus module, 3.4.1, which should be released sometime next week, most likely. It's currently in the store in the development channel.
]]></description><link>https://forum.mango-os.com/topic/2399/mod10k</link><guid isPermaLink="true">https://forum.mango-os.com/topic/2399/mod10k</guid><dc:creator><![CDATA[phildunlap]]></dc:creator><pubDate>Fri, 05 Aug 2016 22:16:48 GMT</pubDate></item><item><title><![CDATA[[SOLVED] Modbus TCP Master error]]></title><description><![CDATA[Nice! Thanks for sharing the solution!
]]></description><link>https://forum.mango-os.com/topic/2342/solved-modbus-tcp-master-error</link><guid isPermaLink="true">https://forum.mango-os.com/topic/2342/solved-modbus-tcp-master-error</guid><dc:creator><![CDATA[phildunlap]]></dc:creator><pubDate>Mon, 11 Jul 2016 13:15:36 GMT</pubDate></item></channel></rss>