Hello, I am fairly new to Eclipse and Java, however I have an application at work where I need to read about 2000 modbus registers from one of our PLC's, and store it in a text file. I then need another program to write these register values back to the PLC on request. I have the reading from the PLC into a file working correctly using the Jamod library, however I can not get the writing working. I cant find any examples of write multiple registers either. Basically I am just wondering if anyone knows of anywhere there is a specific example of using the 'WriteMultipleRegistersRequest' function/method/class etc, that would be great. I have the program reading in each line of the file, and breaking the line up into variables. I know the number of lines etc, its just the part of storing each of the variables into a usable format for this WriteMultipleRegistersRequest function to use, I am having problems with.
I have defined a Register array, and created a new array, however I am not sure how to populate each position of the array with the integers I have from my file. I assume that once I have done this, I basically can run the trasaction, and it will write the contents of the array to the PLC, starting at the modbus address I specify - and stopping when it reaches the end of the array? If anyone is able to help and show me how I can populate the array, or whatever I need to populate, with each integer I am reading off the file, that would be a huge help. Do I even need to define a Register array? If not, how do I put my values into something usable for this WriteMultipleRegistersRequest to use? Any help would be appreciated.
Oct 29, 2014 - I need to write Modbus RTU master app in Java that support 03 - Read Holding. I found three java libraries: jamod, j2mod, modbus4j. This document is a tutorial for writing Modbus/Serial Master applications utilizing the jamod library. It explains the basics and walk's you through a simple command line Master implementation, that will allow you to read the state of one or more input registers from a slave on the network.
I have only done a touch of java when I was at uni, and havent used it for about 7 years. Regards James. I'm not a Java expert, but I've looked at the Jamod package before. If you download the source package, there are a couple of example programs called 'AOTest.java' and 'AIAOTest.java'. Those demonstrates WriteSingleRegisterRequest rather than WriteMultipleRegistersRequest, but there is quite a bit there to help guide you. Unfortunately Jamod uses auto-generated documentation, so there is a lot of formal boilerplate but not much in the way of examples.
You do need to define a Register array, because WriteMultipleRegistersRequest wants to see one as a parameter. I believe you'll have to call the setter on each element to set the register values. Are you working with Modbus/TCP (Ethernet) or Modbus/RTU (RS-232 or RS-485)?
If you are working with Modbus/TCP then I have some Python libraries which would be a lot easier to work with than Java. This sort of thing is very easy to do in Python with a fraction of the code that it would take to do in Java or C#.
You have clicked on the '?' Button for search help. To search the site, enter your search terms in the box labeled 'search the site' and hit Enter. Some tips for better search results. Precede each search term with a '+', as follows:. +Modbus +TCP Otherwise, any post with either term will match. Use double quotes around phrases, as follows:.
+'Allen Bradley' +ethernetOtherwise, posts containing these words in separate locations will match. To exclude a word, precede it with a '-', as follows:. +Modbus -Plus This will return only posts containing 'Modbus' but NOT containing 'Plus'. Note that common words (and, that, etc.) and words shorter than 2 characters are automatically excluded from searches.
Select the categories for which you would like to see messages displayed. Applications Application Questions and Problems Automation Business The Business of Automation and Control Communications Communications systems and equipment. Engineering Engineering and workplace issues. HMI Human-Machine Interface and SCADA. Information Information resources, documentation. Languages Programming languages. Motion Control Motion control, servos, steppers, etc.
Networking Local and wide area networking in factory automation. Open Control Open interfaces, software and hardware PCs in Automation Computers in manufacturing; also hardware discussion. PLCs PLCs and related questions. Power Generation Power generation equipment control. Process Control Continuous process industries, DCS questions. Sensors Sensor technologies. Software in Automation Software, including programming, OS issues, etc.
Modbus Poll Modbus Poll is a Modbus master simulator designed primarily to help developers of Modbus slave devices or others that want to test and simulate the Modbus protocol. With the multiple document interface you can monitor several Modbus slaves and/or data areas at the same time. For each window you simply specify the Modbus slave ID, function, address, size and poll rate. You can read and write registers and coils from any window. If you want to change a single register, simply double click the value. Or you can change multiple registers/coils.
Multiple data formats such as float, double and long with word order swapping are available. Exception errors are shown on the status line. If you are a slave developer you can compose and send your own test strings in the 'test center' and check the result from the slave in hex numbers. OLE Automation for interfacing with Excel. To interpret and show the Modbus data according to your specific requirements. Edit data in Excel and then transmit the data to your slave device! Try the Excel example.xlsm installed with the program.
Supported protocol variants:. Modbus RTU. Modbus ASCII. Modbus TCP/IP. Modbus RTU Over TCP/IP. Modbus ASCII Over TCP/IP. Modbus UDP/IP.
Viber Viber for Linux lets you send free messages and make free calls to other Viber users on any device and network, in any country. Telegram A messaging app with a focus on speed and security, its super fast, simple and free. Chat is a fast, light and extensible chat client. How to install testdisk on centos commands.
Modbus RTU Over UDP/IP. Modbus ASCII Over UDP/IP MODBUS POLL Technical Facts and Features:. OLE Automation for easy interface to Excel using Macro language VBA. Read/write of up to 125 Registers. Read/write of up to 2000 Inputs/Coils. (Compose your own test strings). Print and print preview.
Monitoring of. to text file. Data logging direct to. Context sensitive help.
such as float, double etc. Adjustable Address.
Font and selection. selection. Broadcast (slave ID 0). Easy control of RS-485 converters with RTS toggle. ENRON/DANIEL Mode. 6 digit addresses Supported Modbus Functions:.
01: Read coil status. 02: Read input status. 03: Read holding registers.
04: Read input registers. Download driver modem true. 05: Force single coil. 06: Preset single register. 15: Force multiple coils. 16: Preset multiple registers.
17: Report slave ID. 22: Mask write register. 23: Read/Write registers Read the quick start guide.