|
| 1 | +# ModbusPal v1.7 by @mrhenrike |
| 2 | +ModbusPal - a Java MODBUS simulator |
| 3 | +- Forked by https://sourceforge.net/projects/modbuspal/ |
| 4 | + |
| 5 | +This release of ModbusPal v1.7 is a release candidate version. |
| 6 | + |
| 7 | +### About ModbusPal |
| 8 | +ModbusPal is a MODBUS slave simulator. Its purpose is to offer an easy to use interface with the capabilities to reproduce complex and realistic MODBUS environments. The core of ModbusPal is written in Java. TCP/IP is supported natively, and the serial communication is supported if RxTx library is installed on the computer. |
| 9 | + |
| 10 | +### What's new in v1.7? |
| 11 | +- Fixing to load a xmpp file |
| 12 | +- Fixing automation chart (requires jfreechart) |
| 13 | +- Fixing add new scripts |
| 14 | +- Added scripts samples on "Examples" directory |
| 15 | +- Updated the User Guide |
| 16 | +- Added optional command line arguments for the executable JAR: |
| 17 | + --loadFile - Loads a previously saved file at launch. Provide the absolute path. |
| 18 | + --portNumber - An IP port number to connect this current configuration. |
| 19 | + --help - A command line help message to display the command line arguments. |
| 20 | + --hide - Start ModbusPal without showing the UI elements so it can run in a headless environment. |
| 21 | +- ModbusPal can be executed without a GUI |
| 22 | +- Updated to jython 2.7.0 |
| 23 | +- Updated to jfree-freechart 1.0.15 |
| 24 | +- Updated to jfree-jcommon 1.0.17 |
| 25 | +- Updated to xml-apis 1.3.04 |
| 26 | +- Updated to itext 2.1.5 |
| 27 | +- Updated to rxtx 2.2.2 |
| 28 | +- Added a docker builder |
| 29 | + |
| 30 | +### Known limitations: |
| 31 | +- "Tuning" features are not documented yet |
| 32 | +- Javadoc very incomplete |
| 33 | + |
| 34 | +### How to run |
| 35 | +You can add your xmpp project from modbuspal as first argument: |
| 36 | +`java -jar /path/absolute/modbuspal-runtime.jar -loadFile=/path/absolute/samples/project01.xmpp` |
| 37 | + |
| 38 | +The load file function is working only xmpp project in 1.7 version and always use absolute path when you informe a file |
| 39 | + |
| 40 | +or you can set MODBUSPAL_PROJECT environment variable as path to your project file and then just run |
| 41 | +`java -jar .\target\modbuspal-runtime.jar` |
| 42 | + |
| 43 | +### Run without UI ### |
| 44 | + |
| 45 | +You can start ModbusPal without showing the UI elements so it can run in a headless environment, or if you just don't care to open the window with the -hide flag. You can use it in conjuction with a project file to make modbuspal start all automations and start listening for requests using the command: |
| 46 | +``` |
| 47 | +java -jar <<pathtojar>>/ModbusPal.jar -loadFile=<<projectfile>> -hide |
| 48 | +``` |
| 49 | +Only works with TCP/IP over port 502 currently. You also need to have all your slaves listening on localhost. |
| 50 | + |
| 51 | +## How to build (Using Docker) ## |
| 52 | +-------------------------------------- |
| 53 | +```docker build -t modbuspal-builder . |
| 54 | +docker run --name modbuspal-builder modbuspal-builder |
| 55 | +docker cp modbuspal-builder:/usr/src/app/dist/ModbusPal.jar . |
| 56 | +docker cp modbuspal-builder:/usr/src/app/dist/modbuspal-help.zip . |
| 57 | +docker cp modbuspal-builder:/usr/src/app/dist/modbuspal-javadoc.zip . |
| 58 | +``` |
| 59 | + |
| 60 | +__You can either run with a included sample project__ |
| 61 | +`docker run -p502:502 -e MODBUSPAL_PROJECT=/projects/project01.xmpp modbuspalruntime` |
| 62 | + |
| 63 | +__Or mount your project and refer to it via environment variables__ |
| 64 | +`docker run -p502:502 -v ${path-to-my-projects}:/projects -e MODBUSPAL_PROJECT=/projects/my-project01.xmpp modbuspalruntime` |
| 65 | + |
| 66 | +## Source-code Project in Java |
| 67 | +### Prerequisites ### |
| 68 | +- Apache Netbeans (https://netbeans.apache.org/) |
| 69 | +- JDK 17 (https://www.oracle.com/java/technologies/javase/jdk17-archive-downloads.html) |
| 70 | +- Download ivy http://ant.apache.org/ivy/download.cgi (suggest extracting to C:\jars) |
| 71 | + |
| 72 | +### Setup Project ### |
| 73 | +1. Download and install netbeans https://netbeans.apache.org/download/index.html |
| 74 | +1. Open Netbeans and select `tools > options > Java > ant` and add the ivy jar to the classpath |
| 75 | +1. Run project |
| 76 | + |
| 77 | +### Build Jar ### |
| 78 | +1. Build Project (click hammer or F11) |
| 79 | +1. Jar will be in [ProjectFolder]/dist |
| 80 | + |
0 commit comments