doc/svghmi/configuration.rst
author Edouard Tisserant <edouard@beremiz.fr>
Thu, 05 Dec 2024 16:45:37 +0100
changeset 4061 e0dfe8b8db4a
parent 3936 129202e555e0
permissions -rw-r--r--
py_ext: rework logic CSV reader FB output refresh logic.

Saving with CSV write FB now triggers CSV read FBs to refresh outputs immediately.
3936
129202e555e0 More documentation. Work in progress.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3925
diff changeset
     1
SVGHMI instances configuration
129202e555e0 More documentation. Work in progress.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3925
diff changeset
     2
==============================
3925
1d383b4c0a23 Doc: re-organize existing, sketch outline, add SVGHMI intro.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
     3
3936
129202e555e0 More documentation. Work in progress.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3925
diff changeset
     4
.. list-table::
129202e555e0 More documentation. Work in progress.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3925
diff changeset
     5
129202e555e0 More documentation. Work in progress.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3925
diff changeset
     6
    * - Multiple SVGHMI instances can be configured simultaneously in the same Beremiz  :doc:`../programming/configuration`, exposing different HMIs.
129202e555e0 More documentation. Work in progress.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3925
diff changeset
     7
129202e555e0 More documentation. Work in progress.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3925
diff changeset
     8
        .. image:: svghmi_multi.png
129202e555e0 More documentation. Work in progress.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3925
diff changeset
     9
129202e555e0 More documentation. Work in progress.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3925
diff changeset
    10
      - .. figure:: svghmi_configuration.png
129202e555e0 More documentation. Work in progress.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3925
diff changeset
    11
129202e555e0 More documentation. Work in progress.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3925
diff changeset
    12
        SVGHMI configuration panel
129202e555e0 More documentation. Work in progress.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3925
diff changeset
    13
129202e555e0 More documentation. Work in progress.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3925
diff changeset
    14
Ports, interfaces, path and MaxConnections
129202e555e0 More documentation. Work in progress.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3925
diff changeset
    15
------------------------------------------
129202e555e0 More documentation. Work in progress.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3925
diff changeset
    16
129202e555e0 More documentation. Work in progress.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3925
diff changeset
    17
    Each SVGHMI instance must bind to different interface-port-path triplet. In case of conflict, a build error is issued.
129202e555e0 More documentation. Work in progress.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3925
diff changeset
    18
129202e555e0 More documentation. Work in progress.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3925
diff changeset
    19
    By default, interface is set to ``localhost``, port to ``8008`` and path is set to :doc:`../programming/configuration` Node's name: ``{name}``.
129202e555e0 More documentation. Work in progress.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3925
diff changeset
    20
    As an example, in case SVGHMI instance is first node in :doc:`../programming/configuration`, default URL to reach HMI is ``http://localhost:8008/svghmi_0``
129202e555e0 More documentation. Work in progress.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3925
diff changeset
    21
129202e555e0 More documentation. Work in progress.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3925
diff changeset
    22
    Up to ``MaxConnections`` clients (i.e. web browser) can connect to the same SVGHMI instance simultaneously.
129202e555e0 More documentation. Work in progress.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3925
diff changeset
    23
    This number has an influence on memory footprint of generated code.
129202e555e0 More documentation. Work in progress.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3925
diff changeset
    24
    In case of repeated connection loss with long TCP `TTL <https://en.wikipedia.org/wiki/Time_to_live>`_, small ``MaxConnections`` number can lead to connection refusal.
129202e555e0 More documentation. Work in progress.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3925
diff changeset
    25
129202e555e0 More documentation. Work in progress.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3925
diff changeset
    26
129202e555e0 More documentation. Work in progress.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3925
diff changeset
    27
129202e555e0 More documentation. Work in progress.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3925
diff changeset
    28
About Security
129202e555e0 More documentation. Work in progress.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3925
diff changeset
    29
^^^^^^^^^^^^^^
129202e555e0 More documentation. Work in progress.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3925
diff changeset
    30
129202e555e0 More documentation. Work in progress.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3925
diff changeset
    31
 ..
129202e555e0 More documentation. Work in progress.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3925
diff changeset
    32
    TODO :
129202e555e0 More documentation. Work in progress.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3925
diff changeset
    33
3925
1d383b4c0a23 Doc: re-organize existing, sketch outline, add SVGHMI intro.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    34
1d383b4c0a23 Doc: re-organize existing, sketch outline, add SVGHMI intro.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    35
Watchdog
1d383b4c0a23 Doc: re-organize existing, sketch outline, add SVGHMI intro.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    36
--------
1d383b4c0a23 Doc: re-organize existing, sketch outline, add SVGHMI intro.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    37
3936
129202e555e0 More documentation. Work in progress.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3925
diff changeset
    38
    Purpose of SVGHMI watchdog is to detect if HMI is still functioning and connected to PLC.
129202e555e0 More documentation. Work in progress.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3925
diff changeset
    39
    ``/HEARTBEAT`` variable is periodically updated by PLC and HMI to detect failure.
129202e555e0 More documentation. Work in progress.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3925
diff changeset
    40
    
129202e555e0 More documentation. Work in progress.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3925
diff changeset
    41
    When SVHGMI server doesn't receive HMI heartbeat in due time, watchdog is triggered, and ``OnWatchdog`` command is executed. 
129202e555e0 More documentation. Work in progress.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3925
diff changeset
    42
    For example, ``OnWatchdog`` can be used to restart a new web browser in case it did crash.
3925
1d383b4c0a23 Doc: re-organize existing, sketch outline, add SVGHMI intro.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    43
3936
129202e555e0 More documentation. Work in progress.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3925
diff changeset
    44
    Only one single client can use watchdog at a time, and ``Watchdog`` configuration setting can be active on only one SVGHMI instance at a time.
129202e555e0 More documentation. Work in progress.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3925
diff changeset
    45
129202e555e0 More documentation. Work in progress.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3925
diff changeset
    46
    ``WatchdogInitial`` and ``WatchdogInterval`` define how long watchdog will accept to wait before receiving first heartbeat,
129202e555e0 More documentation. Work in progress.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3925
diff changeset
    47
    and then how long it will wait in between heartbeats once first heartbeat has been received.
129202e555e0 More documentation. Work in progress.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3925
diff changeset
    48
129202e555e0 More documentation. Work in progress.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3925
diff changeset
    49
129202e555e0 More documentation. Work in progress.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3925
diff changeset
    50
Starting and stopping browser
129202e555e0 More documentation. Work in progress.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3925
diff changeset
    51
-----------------------------
129202e555e0 More documentation. Work in progress.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3925
diff changeset
    52
129202e555e0 More documentation. Work in progress.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3925
diff changeset
    53
    ``OnStart`` and ``OnStop`` configuration settings are commands meant control web browser execution when PLC is started or stopped.
129202e555e0 More documentation. Work in progress.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3925
diff changeset
    54
    PID of commands are monitored, and the end of web browser process is awaited after command. 
129202e555e0 More documentation. Work in progress.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 3925
diff changeset
    55
    If web browser process isn't finished 3s after calling ``OnStop`` command, warning is logged.