Skip to content

Commit 206bff7

Browse files
committed
Improvement the code and create a ModbusPalEnhanced
Improvement the code and create a ModbusPalEnhanced
1 parent 9f14252 commit 206bff7

File tree

414 files changed

+170836
-22
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

414 files changed

+170836
-22
lines changed

.gitignore

Lines changed: 18 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,22 @@
1-
# Compiled class file
2-
*.class
1+
/nbproject/private/
2+
/target/
3+
/javadoc/
34

4-
# Log file
5-
*.log
5+
# Eclipse files #
6+
/.classpath
7+
/.project
8+
/.settings
69

7-
# BlueJ files
8-
*.ctxt
10+
# Intellij Idea
11+
.idea
12+
*.iml
13+
*.ipr
14+
*.iws
915

10-
# Mobile Tools for Java (J2ME)
11-
.mtj.tmp/
16+
/bin/
17+
/doc/
18+
/out/
1219

13-
# Package Files #
14-
*.jar
15-
*.war
16-
*.nar
17-
*.ear
18-
*.zip
19-
*.tar.gz
20-
*.rar
21-
22-
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
23-
hs_err_pid*
24-
replay_pid*
20+
/build/
21+
/dist/
22+
/lib/

Dockerfile

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
FROM openjdk:16-jdk-alpine
2+
3+
ARG JYTHON_VERSION=2.7.0
4+
ARG JYTHON_HOME=/usr/src/jython-$JYTHON_VERSION
5+
6+
ENV JYTHON_VERSION=$JYTHON_VERSION
7+
ENV JYTHON_HOME=$JYTHON_HOME
8+
ENV PATH=$PATH:$JYTHON_HOME/bin
9+
10+
RUN apk update
11+
12+
RUN set -eux && \
13+
apk add --no-cache bash && \
14+
apk add --no-cache zip && \
15+
apk add --no-cache apache-ant && \
16+
apk add --no-cache fontconfig ttf-dejavu
17+
18+
19+
20+
WORKDIR /usr/src
21+
22+
RUN set -eux && \
23+
apk add --no-cache wget && \
24+
wget -cO ivy.zip https://dlcdn.apache.org//ant/ivy/2.5.1/apache-ivy-2.5.1-bin-with-deps.zip &&\
25+
unzip ivy.zip && \
26+
rm -f ivy.zip && \
27+
apk del wget
28+
29+
WORKDIR /usr/src/app
30+
COPY . .
31+
32+
RUN ant compile -lib ../apache-ivy-2.5.1/ivy-2.5.1.jar
33+
RUN ant jar -lib ../apache-ivy-2.5.1/ivy-2.5.1.jar
34+
35+
36+
WORKDIR /usr/src/app/
37+
38+
39+
40+

Docs/ModbusPal UserGuide.docx

839 KB
Binary file not shown.

Docs/ModbusPal UserGuide.pdf

1.35 MB
Binary file not shown.

Docs/README.TXT

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
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+

Docs/icon.png

1.81 KB
Loading

Docs/icon_eye1.gif

5.92 KB
Loading

Docs/icons.png

60.1 KB
Loading

Docs/icons.vsd

132 KB
Binary file not shown.

Docs/modbuspal.png

69.8 KB
Loading

0 commit comments

Comments
 (0)