Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Please select a topic in the left hand column.
source/server
source/repl
source/simulator3
source/simulator
source/simulator/simulator
source/examples
source/authors
Expand Down
Binary file modified doc/source/_static/examples.tgz
Binary file not shown.
Binary file modified doc/source/_static/examples.zip
Binary file not shown.
86 changes: 12 additions & 74 deletions doc/source/simulator.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ The simulator allows the user to (all automated):
- test how a client handles modbus response and exceptions,
- test a client apps correct use of the simulated device.

For details please see:

- :ref:`Data model configuration`
- :ref:`Simulator server`

The web interface (activated optionally) allows the user to:

- introduce modbus errors (like e.g. wrong length),
Expand All @@ -27,6 +32,11 @@ The web interface (activated optionally) allows the user to:
- inject modbus errors like malicious a response,
- run your test server in the cloud,

For details please see:

- :ref:`Web frontend`


The REST API allow the test process to be automated

- spin up a test server in your test harness,
Expand All @@ -37,78 +47,6 @@ The REST API allow the test process to be automated
The web server uses the REST API internally, which helps to ensure that it
actually works.

For details please see:

Data model configuration
------------------------

.. warning:: from v3.9.0 this is available as a "normal" datastore model.

The simulator data model represent the registers and parameters of the simulated devices.
The data model is defined using :class:`SimData` and :class:`SimDevice` before starting the
server and cannot be changed without restarting the server.

:class:`SimData` defines a group of continuous identical registers. This is the basis of the model,
multiple :class:`SimData` should be used to mirror the physical device.

:class:`SimDevice` defines device parameters and a list of :class:`SimData`.
The list of :class:`SimData` can added as shared registers or as the 4 blocks, defined in modbus.
:class:`SimDevice` can be used to simulate a single device, while a list of
:class:`SimDevice` simulates a multipoint line (simulating a rs485 line or a tcp based serial forwarder).

A server consist of communication parameters and a device or a list of devices

:class:`SimDataType` is a helper class that defines legal datatypes.

:class:`SimValueType` is a helper class that defines legal value types.

:github:`examples/simulator_datamodel.py` contains usage examples.

SimData
^^^^^^^

.. autoclass:: pymodbus.simulator.SimData
:members:
:undoc-members:
:show-inheritance:

SimDevice
^^^^^^^^^

.. autoclass:: pymodbus.simulator.SimDevice
:members:
:undoc-members:
:show-inheritance:

SimDataType
^^^^^^^^^^^

.. autoclass:: pymodbus.simulator.SimDataType
:members:
:undoc-members:
:show-inheritance:

SimDataValue
^^^^^^^^^^^^

.. autoclass:: pymodbus.simulator.SimDataValue
:members:
:undoc-members:
:show-inheritance:


Simulator server
----------------

.. note:: This is a v4.0.0 functionality currently not available, please see the 3x simulator server.


Web frontend
------------

.. note:: This is a v4.0.0 functionality currently not available, please see the 3x simulator server.


REST API
--------

.. note:: This is a v4.0.0 functionality currently not available, please see the 3x simulator server.
- :ref:`REST API`