You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@plc4x.apache.org by cd...@apache.org on 2020/03/06 08:51:53 UTC
[plc4x] 02/02: - Added the documentation for the Modbus protocol
This is an automated email from the ASF dual-hosted git repository.
cdutz pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/plc4x.git
commit 7f988fda3dc246e9c7523bc75409dbee8892a125
Author: Christofer Dutz <ch...@c-ware.de>
AuthorDate: Fri Mar 6 09:51:43 2020 +0100
- Added the documentation for the Modbus protocol
---
src/site/asciidoc/users/protocols/ab-eth.adoc | 2 +-
src/site/asciidoc/users/protocols/ads.adoc | 2 +-
src/site/asciidoc/users/protocols/bacnetip.adoc | 2 +-
src/site/asciidoc/users/protocols/deltav.adoc | 2 +-
src/site/asciidoc/users/protocols/df1.adoc | 2 +-
src/site/asciidoc/users/protocols/ethernet-ip.adoc | 2 +-
src/site/asciidoc/users/protocols/index.adoc | 2 +-
src/site/asciidoc/users/protocols/knxnetip.adoc | 2 +-
src/site/asciidoc/users/protocols/modbus.adoc | 93 +++++++++++++++++++++-
src/site/asciidoc/users/protocols/opc-ua.adoc | 2 +-
src/site/asciidoc/users/protocols/s7.adoc | 4 +-
src/site/asciidoc/users/protocols/simulated.adoc | 2 +-
.../asciidoc/users/transports/pcap-replay.adoc | 4 +-
13 files changed, 106 insertions(+), 15 deletions(-)
diff --git a/src/site/asciidoc/users/protocols/ab-eth.adoc b/src/site/asciidoc/users/protocols/ab-eth.adoc
index 2b9228b..c00b0f4 100644
--- a/src/site/asciidoc/users/protocols/ab-eth.adoc
+++ b/src/site/asciidoc/users/protocols/ab-eth.adoc
@@ -14,7 +14,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//
-:imagesdir: ../../images/
+:imagesdir: ../../images/users/protocols
:icons: font
== AB-ETH
diff --git a/src/site/asciidoc/users/protocols/ads.adoc b/src/site/asciidoc/users/protocols/ads.adoc
index ca9f2ab..78e5fce 100644
--- a/src/site/asciidoc/users/protocols/ads.adoc
+++ b/src/site/asciidoc/users/protocols/ads.adoc
@@ -14,7 +14,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//
-:imagesdir: ../../images/
+:imagesdir: ../../images/users/protocols
:icons: font
== ADS/AMS
diff --git a/src/site/asciidoc/users/protocols/bacnetip.adoc b/src/site/asciidoc/users/protocols/bacnetip.adoc
index 0bdbc25..2ccb79d 100644
--- a/src/site/asciidoc/users/protocols/bacnetip.adoc
+++ b/src/site/asciidoc/users/protocols/bacnetip.adoc
@@ -14,7 +14,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//
-:imagesdir: ../../images/
+:imagesdir: ../../images/users/protocols
:icons: font
== BACnet/IP
diff --git a/src/site/asciidoc/users/protocols/deltav.adoc b/src/site/asciidoc/users/protocols/deltav.adoc
index 01ce59a..869c8ce 100644
--- a/src/site/asciidoc/users/protocols/deltav.adoc
+++ b/src/site/asciidoc/users/protocols/deltav.adoc
@@ -14,7 +14,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//
-:imagesdir: ../../images/
+:imagesdir: ../../images/users/protocols
:icons: font
== DeltaV
diff --git a/src/site/asciidoc/users/protocols/df1.adoc b/src/site/asciidoc/users/protocols/df1.adoc
index 0ad3b86..584df26 100644
--- a/src/site/asciidoc/users/protocols/df1.adoc
+++ b/src/site/asciidoc/users/protocols/df1.adoc
@@ -14,7 +14,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//
-:imagesdir: ../../images/
+:imagesdir: ../../images/users/protocols
:icons: font
== DF1
diff --git a/src/site/asciidoc/users/protocols/ethernet-ip.adoc b/src/site/asciidoc/users/protocols/ethernet-ip.adoc
index 971aa15..ea74747 100644
--- a/src/site/asciidoc/users/protocols/ethernet-ip.adoc
+++ b/src/site/asciidoc/users/protocols/ethernet-ip.adoc
@@ -14,7 +14,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//
-:imagesdir: ../../images/
+:imagesdir: ../../images/users/protocols
:icons: font
== EtherNet/IP
diff --git a/src/site/asciidoc/users/protocols/index.adoc b/src/site/asciidoc/users/protocols/index.adoc
index 96f6dcd..30f6b06 100644
--- a/src/site/asciidoc/users/protocols/index.adoc
+++ b/src/site/asciidoc/users/protocols/index.adoc
@@ -14,7 +14,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//
-:imagesdir: ../../images/
+:imagesdir: ../../images/users/protocols
:icons: font
== Protocols
diff --git a/src/site/asciidoc/users/protocols/knxnetip.adoc b/src/site/asciidoc/users/protocols/knxnetip.adoc
index 42dbeb8..632de18 100644
--- a/src/site/asciidoc/users/protocols/knxnetip.adoc
+++ b/src/site/asciidoc/users/protocols/knxnetip.adoc
@@ -14,7 +14,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//
-:imagesdir: ../../images/
+:imagesdir: ../../images/users/protocols
:icons: font
== KNXnet/IP
diff --git a/src/site/asciidoc/users/protocols/modbus.adoc b/src/site/asciidoc/users/protocols/modbus.adoc
index 90df9ae..74a61a4 100644
--- a/src/site/asciidoc/users/protocols/modbus.adoc
+++ b/src/site/asciidoc/users/protocols/modbus.adoc
@@ -14,7 +14,98 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//
-:imagesdir: ../../images/
+:imagesdir: ../../images/users/protocols
:icons: font
== Modbus (TCP/Serial)
+
+=== Connection String Options
+
+[cols="2,2a,5a"]
+|===
+|Name |Value |Description
+
+|Code
+2+|`modbus`
+
+|Name
+2+|Modbus
+
+|Maven Dependency
+2+|
+----
+<dependency>
+ <groupId>org.apache.plc4x</groupId>
+ <artifactId>plc4j-driver-modbus</artifactId>
+ <version>{current-last-released-version}</version>
+</dependency>
+----
+
+|Default Transport:
+2+| `tcp`
+
+|Compatible Transports:
+2+| - `tcp` (Default Port: 502)
+- `serial`
+- `raw-socket`
+- `pcap-replay`
+
+3+|Supported Operations
+
+|
+| `read`
+| Only supported with `tcp` and `serial` transport.
+
+|
+| `write`
+| Only supported with `tcp` and `serial` transport.
+
+|
+| `subscribe` (passive)
+| Only supported with `raw-socket` and `pcap-replay`.
+
+3+|Options
+
+|
+| `request-timeout` (1000ms)
+| `Rack` value for the client (PLC4X device). Defaults to 1.
+
+|
+| `unit-identifier` (1)
+| `Slot` value for the client (PLC4X device). Defaults to 1.
+
+|===
+
+=== Individual Resource Address Format
+
+In contrast to most other protocols Modbus only supports two datatypes.
+
+- Bit (Coil)
+- Short (2-bytes) (Registers)
+
+Some implementations implement more types based on these, such as 16 bit half-precision floating point types wrapped in a Register or joining multiple Coils or Registers to bigger data-types, but this is not handled by the Modbus specification.
+
+Coils and Registers are generally separated into pure inputs which are read-only and writable versions.
+
+Inputs (Read-Only):
+
+- Discrete Input (Boolean / 1 bit)
+- Input Register (Short / 16 bi)
+
+Output (Read/Write):
+
+- Coil (Boolean / 1 bit)
+- Holding Register (Short / 16 bi)
+
+Here come the syntax descriptions of these addresses (Each address can reference either a single item or an array):
+
+[cols="2,2a,5,1"]
+|===
+|Name |Address Syntax |Description |Bit-Size
+
+|Discrete Input |`discrete-input:{start-address}` or `discrete-input:{start-address}[{count}]` |Read-only Boolean input value, usually representing a binary input to the PLC |1
+|Input Register |`input-register:{start-address}` or `input-register:{start-address}[{count}]` |Read-only Short input value, usually representing an analog input to the PLC |16
+|Coil |`coil:{start-address}` or `coil:{start-address}[{count}]` |Read/Write Boolean value, usually representing a binary output from the PLC |1
+|Holding Register |`holding-register:{start-address}` or `holding-register:{start-address}[{count}]` |Read/Write Short value, usually representing an analog output from the PLC |16
+
+|===
diff --git a/src/site/asciidoc/users/protocols/opc-ua.adoc b/src/site/asciidoc/users/protocols/opc-ua.adoc
index 046141a..26f6eac 100644
--- a/src/site/asciidoc/users/protocols/opc-ua.adoc
+++ b/src/site/asciidoc/users/protocols/opc-ua.adoc
@@ -14,7 +14,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//
-:imagesdir: ../../images/
+:imagesdir: ../../images/users/protocols
:icons: font
== OPC UA
diff --git a/src/site/asciidoc/users/protocols/s7.adoc b/src/site/asciidoc/users/protocols/s7.adoc
index 2a65b5c..6018589 100644
--- a/src/site/asciidoc/users/protocols/s7.adoc
+++ b/src/site/asciidoc/users/protocols/s7.adoc
@@ -61,8 +61,8 @@
|
| `subscribe`
-| Generally supported with `tcp` transport with S7 devices of types: `S7 300`, `S7 400`, `S7 1500`.
-With `raw-socket` and `pcap-replay` supported on all devices.
+| Generally supported with `tcp` transport with S7 devices of types: `S7 300`, `S7 400`, `S7 1500` (active and passive).
+With `raw-socket` and `pcap-replay` supported on all devices (passive).
3+|Options
diff --git a/src/site/asciidoc/users/protocols/simulated.adoc b/src/site/asciidoc/users/protocols/simulated.adoc
index a6aaef2..f3e4298 100644
--- a/src/site/asciidoc/users/protocols/simulated.adoc
+++ b/src/site/asciidoc/users/protocols/simulated.adoc
@@ -14,7 +14,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//
-:imagesdir: ../../images/
+:imagesdir: ../../images/users/protocols
:icons: font
== Simulated
diff --git a/src/site/asciidoc/users/transports/pcap-replay.adoc b/src/site/asciidoc/users/transports/pcap-replay.adoc
index 5e01837..464a5eb 100644
--- a/src/site/asciidoc/users/transports/pcap-replay.adoc
+++ b/src/site/asciidoc/users/transports/pcap-replay.adoc
@@ -49,7 +49,7 @@
3+|Options:
|
-|replay-speed-factor
+|`replay-speed-factor` (1)
|Numeric value for changing the replay speed:
* 1 = Normal speed (default)
@@ -58,7 +58,7 @@
* 2 = Double speed
|
-|loop
+|`loop` (false)
|Should the replay start at the beginning of the file as soon as the end is reached?
* true = Automatically start again