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.

  • How do I set the value of slave to auto increase?

    1
    0 Votes
    1 Posts
    754 Views
    No one has replied
  • Problem with library repository

    1
    0 Votes
    1 Posts
    757 Views
    No one has replied
  • This topic is deleted!

    1
    0 Votes
    1 Posts
    1 Views
    No one has replied
  • Help understanding addresses (offsets)

    3
    0 Votes
    3 Posts
    941 Views
    V
    @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< Boolean > clickX001 = BaseLocator.inputStatus( 1, 0 ); // Click X001: input BIT on CPU BaseLocator< Boolean > clickY001 = BaseLocator.coilStatus( 1, 0 ); // Click Y001: output COIL on CPU BaseLocator< Boolean > clickY002 = BaseLocator.coilStatus( 1, 1 ); // Click Y002: output COIL on CPU BaseLocator< Number > 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]
  • Feedback on Modbus4j

    2
    0 Votes
    2 Posts
    2k Views
    JoelHaggarJ
    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.
  • Modbus identifying serial ports

    2
    0 Votes
    2 Posts
    2k Views
    phildunlapP
    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"
  • TCP/IP MODBUS ANDROID

    4
    0 Votes
    4 Posts
    4k Views
    A
    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.
  • MODBUS RTU discovery.

    2
    0 Votes
    2 Posts
    2k Views
    CraigWebC
    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 ??
  • Modbus4J throwing error.

    5
    0 Votes
    5 Posts
    3k Views
    phildunlapP
    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.
  • MODBUS JAVA agent for data acquisition

    4
    0 Votes
    4 Posts
    3k Views
    V
    @phildunlap thanks a lot.
  • Modbus4j won't talk with InTouch (DASMBTCP)

    5
    0 Votes
    5 Posts
    2k Views
    phildunlapP
    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.
  • Mod10K

    9
    0 Votes
    9 Posts
    6k Views
    phildunlapP
    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.
  • Error Importing Modbus4J Library in Netbeans

    2
    0 Votes
    2 Posts
    2k Views
    phildunlapP
    Seems like a path issue. Is modbus4j on your classpath?
  • 0 Votes
    9 Posts
    4k Views
    phildunlapP
    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.
  • 0 Votes
    2 Posts
    2k Views
    phildunlapP
    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.
  • How to import Modbus4J into Android studio?

    2
    0 Votes
    2 Posts
    2k Views
    phildunlapP
    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
  • How to add Modbus 4j Library to Android studio

    modbus
    1
    0 Votes
    1 Posts
    2k Views
    No one has replied
  • Multiple register writes

    6
    0 Votes
    6 Posts
    6k Views
    B
    @nikorun where this master.setValue (...) line should be added ?
  • 0 Votes
    1 Posts
    1k Views
    No one has replied
  • Need a Modbus polling program using Modbus4J

    4
    0 Votes
    4 Posts
    3k Views
    JoelHaggarJ
    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