You should adapt the serial parameters to your requirements, which you can do hardcoded or by reading in the parameters from the commandline or as properties file. SerialParameters params = new SerialParameters() ModbusCoupler.getReference().setUnitID(1) The application build in the tutorial is actually part of the distribution codebase ( .SerialAITest). However, there is also support for building with the gnu.io prefix (RXTX), via the boolean build property ( true will cause the build process to replace the m prefix with gnu.io in the sources used for builds). You will need an implementation of the Java Communications API extension ( m) installed to be able to run serial modbus applications. ![]() If you are new to Modbus, it is highly recommended to first take a look at Understanding the Protocol (especially the section about the Serial implementation) as well as the actual protocol specifications (see Knowledge Base Index). 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. ![]() This document is a tutorial for writing Modbus/Serial Master applications utilizing the jamod library.
0 Comments
Leave a Reply. |