pymscada 0.0.14__tar.gz → 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of pymscada might be problematic. Click here for more details.

Files changed (84) hide show
  1. pymscada-0.1.0/PKG-INFO +88 -0
  2. pymscada-0.1.0/README.md +67 -0
  3. {pymscada-0.0.14 → pymscada-0.1.0}/pyproject.toml +2 -3
  4. {pymscada-0.0.14 → pymscada-0.1.0}/src/pymscada/checkout.py +38 -5
  5. {pymscada-0.0.14 → pymscada-0.1.0}/src/pymscada/demo/logixclient.yaml +24 -23
  6. {pymscada-0.0.14 → pymscada-0.1.0}/src/pymscada/demo/modbusclient.yaml +22 -18
  7. {pymscada-0.0.14 → pymscada-0.1.0}/src/pymscada/demo/modbusserver.yaml +10 -2
  8. pymscada-0.1.0/src/pymscada/demo/ping.yaml +12 -0
  9. pymscada-0.1.0/src/pymscada/demo/pymscada-io-ping.service +15 -0
  10. {pymscada-0.0.14 → pymscada-0.1.0}/src/pymscada/demo/snmpclient.yaml +17 -17
  11. {pymscada-0.0.14 → pymscada-0.1.0}/src/pymscada/demo/tags.yaml +50 -1
  12. pymscada-0.1.0/src/pymscada/demo/wwwserver.yaml +533 -0
  13. {pymscada-0.0.14 → pymscada-0.1.0}/src/pymscada/iodrivers/logix_client.py +9 -9
  14. pymscada-0.1.0/src/pymscada/iodrivers/logix_map.py +144 -0
  15. {pymscada-0.0.14 → pymscada-0.1.0}/src/pymscada/iodrivers/modbus_client.py +20 -34
  16. {pymscada-0.0.14 → pymscada-0.1.0}/src/pymscada/iodrivers/modbus_map.py +4 -1
  17. {pymscada-0.0.14 → pymscada-0.1.0}/src/pymscada/iodrivers/modbus_server.py +34 -48
  18. pymscada-0.1.0/src/pymscada/iodrivers/ping_client.py +120 -0
  19. pymscada-0.1.0/src/pymscada/iodrivers/ping_map.py +43 -0
  20. {pymscada-0.0.14 → pymscada-0.1.0}/src/pymscada/iodrivers/snmp_client.py +4 -2
  21. {pymscada-0.0.14 → pymscada-0.1.0}/src/pymscada/iodrivers/snmp_map.py +1 -1
  22. pymscada-0.1.0/src/pymscada/main.py +270 -0
  23. {pymscada-0.0.14 → pymscada-0.1.0}/src/pymscada/validate.py +127 -35
  24. {pymscada-0.0.14 → pymscada-0.1.0}/tests/iodrivers/test_logix.py +30 -21
  25. {pymscada-0.0.14 → pymscada-0.1.0}/tests/iodrivers/test_modbus.py +4 -4
  26. {pymscada-0.0.14 → pymscada-0.1.0}/tests/test_tag.py +1 -1
  27. {pymscada-0.0.14 → pymscada-0.1.0}/tests/test_validate.py +2 -1
  28. pymscada-0.0.14/PKG-INFO +0 -251
  29. pymscada-0.0.14/README.md +0 -230
  30. pymscada-0.0.14/src/pymscada/demo/simulate.yaml +0 -21
  31. pymscada-0.0.14/src/pymscada/demo/wwwserver.yaml +0 -87
  32. pymscada-0.0.14/src/pymscada/iodrivers/logix_map.py +0 -132
  33. pymscada-0.0.14/src/pymscada/main.py +0 -102
  34. pymscada-0.0.14/src/pymscada/simulate.py +0 -66
  35. {pymscada-0.0.14 → pymscada-0.1.0}/LICENSE +0 -0
  36. {pymscada-0.0.14 → pymscada-0.1.0}/src/pymscada/__init__.py +0 -0
  37. {pymscada-0.0.14 → pymscada-0.1.0}/src/pymscada/__main__.py +0 -0
  38. {pymscada-0.0.14 → pymscada-0.1.0}/src/pymscada/bus_client.py +0 -0
  39. {pymscada-0.0.14 → pymscada-0.1.0}/src/pymscada/bus_server.py +0 -0
  40. {pymscada-0.0.14 → pymscada-0.1.0}/src/pymscada/config.py +0 -0
  41. {pymscada-0.0.14 → pymscada-0.1.0}/src/pymscada/console.py +0 -0
  42. {pymscada-0.0.14 → pymscada-0.1.0}/src/pymscada/demo/README.md +0 -0
  43. {pymscada-0.0.14 → pymscada-0.1.0}/src/pymscada/demo/__init__.py +0 -0
  44. {pymscada-0.0.14 → pymscada-0.1.0}/src/pymscada/demo/bus.yaml +0 -0
  45. {pymscada-0.0.14 → pymscada-0.1.0}/src/pymscada/demo/files.yaml +0 -0
  46. {pymscada-0.0.14 → pymscada-0.1.0}/src/pymscada/demo/history.yaml +0 -0
  47. {pymscada-0.0.14 → pymscada-0.1.0}/src/pymscada/demo/modbus_plc.py +0 -0
  48. {pymscada-0.0.14 → pymscada-0.1.0}/src/pymscada/demo/pymscada-bus.service +0 -0
  49. {pymscada-0.0.14 → pymscada-0.1.0}/src/pymscada/demo/pymscada-demo-modbus_plc.service +0 -0
  50. {pymscada-0.0.14 → pymscada-0.1.0}/src/pymscada/demo/pymscada-files.service +0 -0
  51. {pymscada-0.0.14 → pymscada-0.1.0}/src/pymscada/demo/pymscada-history.service +0 -0
  52. {pymscada-0.0.14 → pymscada-0.1.0}/src/pymscada/demo/pymscada-io-logixclient.service +0 -0
  53. /pymscada-0.0.14/src/pymscada/demo/pymscada-modbusclient.service → /pymscada-0.1.0/src/pymscada/demo/pymscada-io-modbusclient.service +0 -0
  54. /pymscada-0.0.14/src/pymscada/demo/pymscada-modbusserver.service → /pymscada-0.1.0/src/pymscada/demo/pymscada-io-modbusserver.service +0 -0
  55. {pymscada-0.0.14 → pymscada-0.1.0}/src/pymscada/demo/pymscada-io-snmpclient.service +0 -0
  56. {pymscada-0.0.14 → pymscada-0.1.0}/src/pymscada/demo/pymscada-wwwserver.service +0 -0
  57. {pymscada-0.0.14 → pymscada-0.1.0}/src/pymscada/files.py +0 -0
  58. {pymscada-0.0.14 → pymscada-0.1.0}/src/pymscada/history.py +0 -0
  59. {pymscada-0.0.14 → pymscada-0.1.0}/src/pymscada/iodrivers/__init__.py +0 -0
  60. {pymscada-0.0.14 → pymscada-0.1.0}/src/pymscada/misc.py +0 -0
  61. {pymscada-0.0.14 → pymscada-0.1.0}/src/pymscada/pdf/__init__.py +0 -0
  62. {pymscada-0.0.14 → pymscada-0.1.0}/src/pymscada/pdf/one.pdf +0 -0
  63. {pymscada-0.0.14 → pymscada-0.1.0}/src/pymscada/pdf/two.pdf +0 -0
  64. {pymscada-0.0.14 → pymscada-0.1.0}/src/pymscada/periodic.py +0 -0
  65. {pymscada-0.0.14 → pymscada-0.1.0}/src/pymscada/protocol_constants.py +0 -0
  66. {pymscada-0.0.14 → pymscada-0.1.0}/src/pymscada/samplers.py +0 -0
  67. {pymscada-0.0.14 → pymscada-0.1.0}/src/pymscada/tag.py +0 -0
  68. {pymscada-0.0.14/src/pymscada/iodrivers → pymscada-0.1.0/src/pymscada/tools}/snmp_client2.py +0 -0
  69. {pymscada-0.0.14 → pymscada-0.1.0}/src/pymscada/tools/walk.py +0 -0
  70. {pymscada-0.0.14 → pymscada-0.1.0}/src/pymscada/www_server.py +0 -0
  71. {pymscada-0.0.14 → pymscada-0.1.0}/tests/__init__.py +0 -0
  72. {pymscada-0.0.14 → pymscada-0.1.0}/tests/bus_echo.py +0 -0
  73. {pymscada-0.0.14 → pymscada-0.1.0}/tests/test_assets/busserver.yaml +0 -0
  74. {pymscada-0.0.14 → pymscada-0.1.0}/tests/test_assets/hist_tag_0_0.dat +0 -0
  75. {pymscada-0.0.14 → pymscada-0.1.0}/tests/test_assets/hist_tag_0_10_2.dat +0 -0
  76. {pymscada-0.0.14 → pymscada-0.1.0}/tests/test_assets/hist_tag_0_15.dat +0 -0
  77. {pymscada-0.0.14 → pymscada-0.1.0}/tests/test_assets/hist_tag_0_26.dat +0 -0
  78. {pymscada-0.0.14 → pymscada-0.1.0}/tests/test_assets/hist_tag_0_50.dat +0 -0
  79. {pymscada-0.0.14 → pymscada-0.1.0}/tests/test_bus_server.py +0 -0
  80. {pymscada-0.0.14 → pymscada-0.1.0}/tests/test_config.py +0 -0
  81. {pymscada-0.0.14 → pymscada-0.1.0}/tests/test_misc.py +0 -0
  82. {pymscada-0.0.14 → pymscada-0.1.0}/tests/test_periodic.py +0 -0
  83. {pymscada-0.0.14 → pymscada-0.1.0}/tests/test_samplers.py +0 -0
  84. {pymscada-0.0.14 → pymscada-0.1.0}/tests/test_tag_history.py +0 -0
@@ -0,0 +1,88 @@
1
+ Metadata-Version: 2.1
2
+ Name: pymscada
3
+ Version: 0.1.0
4
+ Summary: Shared tag value SCADA with python backup and Angular UI
5
+ Author-Email: Jamie Walton <jamie@walton.net.nz>
6
+ License: GPL-3.0-or-later
7
+ Classifier: Programming Language :: Python :: 3
8
+ Classifier: Programming Language :: JavaScript
9
+ Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
10
+ Classifier: Operating System :: OS Independent
11
+ Classifier: Environment :: Console
12
+ Classifier: Development Status :: 1 - Planning
13
+ Requires-Python: >=3.9
14
+ Requires-Dist: PyYAML>=6.0.1
15
+ Requires-Dist: aiohttp>=3.8.5
16
+ Requires-Dist: pymscada-html==0.1.0
17
+ Requires-Dist: cerberus>=1.3.5
18
+ Requires-Dist: pycomm3>=1.2.14
19
+ Requires-Dist: pysnmplib>=5.0.24
20
+ Description-Content-Type: text/markdown
21
+
22
+ # pymscada
23
+ #### [Docs](https://github.com/jamie0walton/pymscada/blob/main/docs/README.md)
24
+
25
+ #### [@Github](https://github.com/jamie0walton/pymscada/blob/main/README.md)
26
+
27
+ ## Python Mobile SCADA
28
+
29
+ ```pymscada``` read / write to Modbus and Logix PLCs. Read SNMP OIDs.
30
+ Collect history values and provide the ability to set values and trends
31
+ and issue commands.
32
+
33
+ User interface is via a web client embedded in this package. Examples included
34
+ for securing with Apache as a proxy.
35
+
36
+ Configuration with text yaml files, including the web page which are
37
+ procedurally built.
38
+
39
+ # See also
40
+
41
+ - The angular project [angmscada](https://github.com/jamie0walton/angmscada)
42
+ - Python container for the compiled angular pages [pymscada-html](https://github.com/jamie0walton/pymscada-html)
43
+
44
+ # Licence
45
+
46
+ ```pymscada``` is distributed under the GPLv3 [license](./LICENSE).
47
+
48
+ # Use
49
+ Checkout the example files.
50
+ ```bash
51
+ mscada@raspberrypi:~/test $ pymscada checkout
52
+ making 'history' folder
53
+ making pdf dir
54
+ making config dir
55
+ Creating /home/mscada/test/config/modbusclient.yaml
56
+ Creating /home/mscada/test/config/pymscada-history.service
57
+ Creating /home/mscada/test/config/wwwserver.yaml
58
+ Creating /home/mscada/test/config/pymscada-demo-modbus_plc.service
59
+ Creating /home/mscada/test/config/files.yaml
60
+ Creating /home/mscada/test/config/pymscada-modbusserver.service
61
+ Creating /home/mscada/test/config/pymscada-wwwserver.service
62
+ Creating /home/mscada/test/config/simulate.yaml
63
+ Creating /home/mscada/test/config/tags.yaml
64
+ Creating /home/mscada/test/config/history.yaml
65
+ Creating /home/mscada/test/config/pymscada-files.service
66
+ Creating /home/mscada/test/config/bus.yaml
67
+ Creating /home/mscada/test/config/modbusserver.yaml
68
+ Creating /home/mscada/test/config/modbus_plc.py
69
+ Creating /home/mscada/test/config/pymscada-modbusclient.service
70
+ Creating /home/mscada/test/config/pymscada-bus.service
71
+ Creating /home/mscada/test/config/README.md
72
+ mscada@raspberrypi:~/test $ pymscada validate
73
+ WARNING:root:pymscada 0.1.0 starting
74
+ Config files in ./ valid.
75
+ ```
76
+
77
+ Runs on a Raspberry Pi and includes preconfigured systemd files to
78
+ automate running the services. Mostly works on Windows, works better
79
+ on linux.
80
+
81
+ Modules can be run from the command line, although you need
82
+ a terminal for each running module (better with systemd).
83
+ ```bash
84
+ pymscada bus --config bus.yaml
85
+ pymscada wwwserver --config wwwserver.yaml --tags tags.yaml
86
+ pymscada history --config history.yaml --tags tags.yaml
87
+ python weather.py
88
+ ```
@@ -0,0 +1,67 @@
1
+ # pymscada
2
+ #### [Docs](https://github.com/jamie0walton/pymscada/blob/main/docs/README.md)
3
+
4
+ #### [@Github](https://github.com/jamie0walton/pymscada/blob/main/README.md)
5
+
6
+ ## Python Mobile SCADA
7
+
8
+ ```pymscada``` read / write to Modbus and Logix PLCs. Read SNMP OIDs.
9
+ Collect history values and provide the ability to set values and trends
10
+ and issue commands.
11
+
12
+ User interface is via a web client embedded in this package. Examples included
13
+ for securing with Apache as a proxy.
14
+
15
+ Configuration with text yaml files, including the web page which are
16
+ procedurally built.
17
+
18
+ # See also
19
+
20
+ - The angular project [angmscada](https://github.com/jamie0walton/angmscada)
21
+ - Python container for the compiled angular pages [pymscada-html](https://github.com/jamie0walton/pymscada-html)
22
+
23
+ # Licence
24
+
25
+ ```pymscada``` is distributed under the GPLv3 [license](./LICENSE).
26
+
27
+ # Use
28
+ Checkout the example files.
29
+ ```bash
30
+ mscada@raspberrypi:~/test $ pymscada checkout
31
+ making 'history' folder
32
+ making pdf dir
33
+ making config dir
34
+ Creating /home/mscada/test/config/modbusclient.yaml
35
+ Creating /home/mscada/test/config/pymscada-history.service
36
+ Creating /home/mscada/test/config/wwwserver.yaml
37
+ Creating /home/mscada/test/config/pymscada-demo-modbus_plc.service
38
+ Creating /home/mscada/test/config/files.yaml
39
+ Creating /home/mscada/test/config/pymscada-modbusserver.service
40
+ Creating /home/mscada/test/config/pymscada-wwwserver.service
41
+ Creating /home/mscada/test/config/simulate.yaml
42
+ Creating /home/mscada/test/config/tags.yaml
43
+ Creating /home/mscada/test/config/history.yaml
44
+ Creating /home/mscada/test/config/pymscada-files.service
45
+ Creating /home/mscada/test/config/bus.yaml
46
+ Creating /home/mscada/test/config/modbusserver.yaml
47
+ Creating /home/mscada/test/config/modbus_plc.py
48
+ Creating /home/mscada/test/config/pymscada-modbusclient.service
49
+ Creating /home/mscada/test/config/pymscada-bus.service
50
+ Creating /home/mscada/test/config/README.md
51
+ mscada@raspberrypi:~/test $ pymscada validate
52
+ WARNING:root:pymscada 0.1.0 starting
53
+ Config files in ./ valid.
54
+ ```
55
+
56
+ Runs on a Raspberry Pi and includes preconfigured systemd files to
57
+ automate running the services. Mostly works on Windows, works better
58
+ on linux.
59
+
60
+ Modules can be run from the command line, although you need
61
+ a terminal for each running module (better with systemd).
62
+ ```bash
63
+ pymscada bus --config bus.yaml
64
+ pymscada wwwserver --config wwwserver.yaml --tags tags.yaml
65
+ pymscada history --config history.yaml --tags tags.yaml
66
+ python weather.py
67
+ ```
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "pymscada"
3
- version = "0.0.14"
3
+ version = "0.1.0"
4
4
  description = "Shared tag value SCADA with python backup and Angular UI"
5
5
  authors = [
6
6
  { name = "Jamie Walton", email = "jamie@walton.net.nz" },
@@ -8,7 +8,7 @@ authors = [
8
8
  dependencies = [
9
9
  "PyYAML>=6.0.1",
10
10
  "aiohttp>=3.8.5",
11
- "pymscada-html<=0.1.0",
11
+ "pymscada-html==0.1.0",
12
12
  "cerberus>=1.3.5",
13
13
  "pycomm3>=1.2.14",
14
14
  "pysnmplib>=5.0.24",
@@ -43,7 +43,6 @@ test = [
43
43
  "flake8-docstrings>=1.7.0",
44
44
  "pytest-asyncio>=0.21.1",
45
45
  "pytest-cov>=4.1.0",
46
- "pdm>=2.11.1",
47
46
  ]
48
47
  pdm = []
49
48
 
@@ -1,4 +1,5 @@
1
1
  """Create base config folder and check out demo files."""
2
+ import difflib
2
3
  from pathlib import Path
3
4
  import sys
4
5
  from pymscada.config import get_demo_files, get_pdf_files
@@ -36,7 +37,7 @@ def make_pdf():
36
37
  target.write_bytes(pdf_file.read_bytes())
37
38
 
38
39
 
39
- def make_config(overwrite):
40
+ def make_config(overwrite: bool):
40
41
  """Make the config folder, if missing, and copy files in."""
41
42
  config_dir = PATH['__DIR__'].joinpath('config')
42
43
  if not config_dir.exists():
@@ -62,11 +63,43 @@ def make_config(overwrite):
62
63
  target.write_bytes(config_file.read_bytes())
63
64
 
64
65
 
65
- def checkout(overwrite=False):
66
+ def read_with_subst(file: Path):
67
+ """Read the file and replace DIR markers."""
68
+ rd = file.read_bytes().decode()
69
+ if str(file).endswith('service'):
70
+ for k, v in PATH.items():
71
+ rd = rd.replace(k, str(v.absolute()))
72
+ lines = rd.splitlines()
73
+ return lines
74
+
75
+
76
+ def compare_config():
77
+ """Compare old and new config."""
78
+ config_dir = PATH['__DIR__'].joinpath('config')
79
+ if not config_dir.exists():
80
+ print('No config dir, are you in the right directory')
81
+ return
82
+ for config_file in get_demo_files():
83
+ target = config_dir.joinpath(config_file.name)
84
+ if target.exists():
85
+ new_lines = read_with_subst(config_file)
86
+ old_lines = read_with_subst(target)
87
+ diff = list(difflib.unified_diff(old_lines, new_lines,
88
+ fromfile=str(target), tofile=str(config_file)))
89
+ if len(diff):
90
+ print('\n'.join(diff), '\n')
91
+ else:
92
+ print(f'\n--- MISSING FILE\n\n+++ {config_file}')
93
+
94
+
95
+ def checkout(overwrite=False, diff=False):
66
96
  """Do it."""
67
97
  for name in PATH:
68
98
  if not PATH[name].exists():
69
99
  raise SystemExit(f'{PATH[name]} is missing')
70
- make_history()
71
- make_pdf()
72
- make_config(overwrite)
100
+ if diff:
101
+ compare_config()
102
+ else:
103
+ make_history()
104
+ make_pdf()
105
+ make_config(overwrite)
@@ -4,42 +4,43 @@ rtus:
4
4
  - name: Ani
5
5
  ip: 172.26.7.196
6
6
  rate: 0.2
7
- read:
7
+ poll:
8
8
  - {addr: Fout, type: 'REAL[]', start: 0, end: 99}
9
9
  - {addr: Iout, type: 'DINT[]', start: 0, end: 99}
10
10
  - {addr: OutVar, type: REAL}
11
- writeok:
12
- - {addr: Fin, type: 'REAL[]', start: 0, end: 99}
13
- - {addr: Iin, type: 'REAL[]', start: 0, end: 99}
14
- - {addr: InVar, type: REAL}
15
11
  tags:
12
+ Ani_Fin_20:
13
+ type: float32
14
+ read: 'Ani:Fout[20]'
15
+ write: 'Ani:Fin[20]'
16
16
  Ani_Fout_20:
17
17
  type: float32
18
- addr: 'Ani:Fout[20]'
18
+ read: 'Ani:Fout[20]'
19
+ Ani_Iin_20:
20
+ type: int32
21
+ read: 'Ani:Iout[20]'
22
+ write: 'Ani:Iin[20]'
19
23
  Ani_Iout_20:
20
24
  type: int32
21
- addr: 'Ani:Iout[20]'
25
+ read: 'Ani:Iout[20]'
26
+ Ani_Iin_21_0:
27
+ type: bool
28
+ read: 'Ani:Iout[21].0'
29
+ write: 'Ani:Iin[21].0'
22
30
  Ani_Iout_21_0:
23
31
  type: bool
24
- addr: 'Ani:Iout[21].0'
32
+ read: 'Ani:Iout[21].0'
33
+ Ani_Iin_21_1:
34
+ type: bool
35
+ read: 'Ani:Iout[21].1'
36
+ write: 'Ani:Iin[21].1'
25
37
  Ani_Iout_21_1:
26
38
  type: bool
27
- addr: 'Ani:Iout[21].1'
28
- Ani_Fin_20:
29
- type: float32
30
- addr: 'Ani:Fin[20]'
31
- Ani_Iin_20:
32
- type: int32
33
- addr: 'Ani:Iin[20]'
39
+ read: 'Ani:Iout[21].1'
34
40
  InVar:
35
41
  type: float32
36
- addr: Ani:InVar
42
+ read: Ani:OutVar
43
+ write: Ani:InVar
37
44
  OutVar:
38
45
  type: float32
39
- addr: Ani:OutVar
40
- Ani_Iin_21_0:
41
- type: bool
42
- addr: 'Ani:Iin[21].0'
43
- Ani_Iin_21_1:
44
- type: bool
45
- addr: 'Ani:Iin[21].1'
46
+ read: Ani:OutVar
@@ -6,54 +6,58 @@ rtus:
6
6
  port: 1502
7
7
  tcp_udp: tcp
8
8
  rate: 0.2
9
- read:
9
+ poll:
10
10
  - {unit: 1, file: 4x, start: 1, end: 50}
11
11
  - {unit: 1, file: 4x, start: 51, end: 100}
12
- writeok:
13
- - {unit: 1, file: 4x, start: 1, end: 100}
14
12
  tags:
15
13
  IntSet:
16
14
  type: int16
17
- addr: RTU:1:4x:1
15
+ read: RTU:1:4x:1
16
+ write: RTU:1:4x:1
18
17
  IntVal:
19
18
  type: int16
20
- addr: RTU:1:4x:2
19
+ read: RTU:1:4x:2
21
20
  FloatSet:
22
21
  type: float32
23
- addr: RTU:1:4x:3
22
+ read: RTU:1:4x:3
23
+ write: RTU:1:4x:3
24
24
  FloatVal:
25
25
  type: float32
26
- addr: RTU:1:4x:5
26
+ read: RTU:1:4x:5
27
27
  MultiSet:
28
28
  type: int16
29
- addr: RTU:1:4x:7
29
+ read: RTU:1:4x:7
30
+ write: RTU:1:4x:7
30
31
  MultiVal:
31
32
  type: int16
32
- addr: RTU:1:4x:8
33
+ read: RTU:1:4x:8
33
34
  TimeSet:
34
35
  type: uint64
35
- addr: RTU:1:4x:9
36
+ read: RTU:1:4x:9
37
+ write: RTU:1:4x:9
36
38
  TimeVal:
37
39
  type: uint64
38
- addr: RTU:1:4x:13
40
+ read: RTU:1:4x:13
39
41
  DateSet:
40
42
  type: uint64
41
- addr: RTU:1:4x:17
43
+ read: RTU:1:4x:17
44
+ write: RTU:1:4x:17
42
45
  DateVal:
43
46
  type: uint64
44
- addr: RTU:1:4x:21
47
+ read: RTU:1:4x:21
45
48
  DateTimeSet:
46
49
  type: uint64
47
- addr: RTU:1:4x:25
50
+ read: RTU:1:4x:25
51
+ write: RTU:1:4x:25
48
52
  DateTimeVal:
49
53
  type: uint64
50
- addr: RTU:1:4x:29
54
+ read: RTU:1:4x:29
51
55
  cpu_temp:
52
56
  type: float32
53
- addr: RTU:1:4x:33
57
+ read: RTU:1:4x:33
54
58
  cpu_load:
55
59
  type: float32
56
- addr: RTU:1:4x:35
60
+ read: RTU:1:4x:35
57
61
  disk_use:
58
62
  type: float32
59
- addr: RTU:1:4x:37
63
+ read: RTU:1:4x:37
@@ -1,5 +1,5 @@
1
- bus_ip: 192.168.1.100 # for the demo PLC make empty (None)
2
- bus_port: 2345 # for the demo PLC make empty (None)
1
+ bus_ip:
2
+ bus_port:
3
3
  rtus:
4
4
  - name: RTU
5
5
  ip: 0.0.0.0
@@ -7,10 +7,18 @@ rtus:
7
7
  tcp_udp: tcp
8
8
  serve:
9
9
  - {unit: 1, file: 4x, start: 1, end: 100}
10
+ - {unit: 2, file: 4x, start: 1, end: 100}
11
+ - {unit: 3, file: 4x, start: 1, end: 100}
10
12
  tags:
11
13
  sim_IntSet:
12
14
  type: int16
13
15
  addr: RTU:1:4x:1
16
+ sim_IntSet2:
17
+ type: int16
18
+ addr: RTU:2:4x:1
19
+ sim_IntSet3:
20
+ type: int16
21
+ addr: RTU:3:4x:1
14
22
  sim_IntVal:
15
23
  type: int16
16
24
  addr: RTU:1:4x:2
@@ -0,0 +1,12 @@
1
+ bus_ip: 127.0.0.1
2
+ bus_port: 1324
3
+ tags:
4
+ localhost_ping:
5
+ type: ping
6
+ addr: '127.0.0.1'
7
+ electronet_ping:
8
+ type: ping
9
+ addr: electronet.co.nz
10
+ google_ping:
11
+ type: ping
12
+ addr: www.google.com
@@ -0,0 +1,15 @@
1
+ [Unit]
2
+ Description=pymscada - Ping client
3
+ BindsTo=pymscada-bus.service
4
+ After=pymscada-bus.service
5
+
6
+ [Service]
7
+ WorkingDirectory=__DIR__
8
+ ExecStart=__PYMSCADA__ ping --config __DIR__/config/ping.yaml
9
+ Restart=always
10
+ RestartSec=5
11
+ User=mscada
12
+ Group=mscada
13
+
14
+ [Install]
15
+ WantedBy=multi-user.target
@@ -5,7 +5,7 @@ rtus:
5
5
  ip: 172.26.3.254
6
6
  community: public
7
7
  rate: 10
8
- read:
8
+ poll:
9
9
  - '1.3.6.1.2.1.31.1.1.1.6.1'
10
10
  - '1.3.6.1.2.1.31.1.1.1.6.2'
11
11
  - '1.3.6.1.2.1.31.1.1.1.6.3'
@@ -25,49 +25,49 @@ rtus:
25
25
  tags:
26
26
  Router_eth1_bytes_in:
27
27
  type: int_roc
28
- addr: 'router:1.3.6.1.2.1.31.1.1.1.6.1'
28
+ read: 'router:1.3.6.1.2.1.31.1.1.1.6.1'
29
29
  Router_eth1_bytes_out:
30
30
  type: int_roc
31
- addr: 'router:1.3.6.1.2.1.31.1.1.1.10.1'
31
+ read: 'router:1.3.6.1.2.1.31.1.1.1.10.1'
32
32
  Router_eth2_bytes_in:
33
33
  type: int_roc
34
- addr: 'router:1.3.6.1.2.1.31.1.1.1.6.2'
34
+ read: 'router:1.3.6.1.2.1.31.1.1.1.6.2'
35
35
  Router_eth2_bytes_out:
36
36
  type: int_roc
37
- addr: 'router:1.3.6.1.2.1.31.1.1.1.10.2'
37
+ read: 'router:1.3.6.1.2.1.31.1.1.1.10.2'
38
38
  Router_eth3_bytes_in:
39
39
  type: int_roc
40
- addr: 'router:1.3.6.1.2.1.31.1.1.1.6.3'
40
+ read: 'router:1.3.6.1.2.1.31.1.1.1.6.3'
41
41
  Router_eth3_bytes_out:
42
42
  type: int_roc
43
- addr: 'router:1.3.6.1.2.1.31.1.1.1.10.3'
43
+ read: 'router:1.3.6.1.2.1.31.1.1.1.10.3'
44
44
  Router_eth4_bytes_in:
45
45
  type: int_roc
46
- addr: 'router:1.3.6.1.2.1.31.1.1.1.6.4'
46
+ read: 'router:1.3.6.1.2.1.31.1.1.1.6.4'
47
47
  Router_eth4_bytes_out:
48
48
  type: int_roc
49
- addr: 'router:1.3.6.1.2.1.31.1.1.1.10.4'
49
+ read: 'router:1.3.6.1.2.1.31.1.1.1.10.4'
50
50
  Router_eth5_bytes_in:
51
51
  type: int_roc
52
- addr: 'router:1.3.6.1.2.1.31.1.1.1.6.5'
52
+ read: 'router:1.3.6.1.2.1.31.1.1.1.6.5'
53
53
  Router_eth5_bytes_out:
54
54
  type: int_roc
55
- addr: 'router:1.3.6.1.2.1.31.1.1.1.10.5'
55
+ read: 'router:1.3.6.1.2.1.31.1.1.1.10.5'
56
56
  Router_eth6_bytes_in:
57
57
  type: int_roc
58
- addr: 'router:1.3.6.1.2.1.31.1.1.1.6.6'
58
+ read: 'router:1.3.6.1.2.1.31.1.1.1.6.6'
59
59
  Router_eth6_bytes_out:
60
60
  type: int_roc
61
- addr: 'router:1.3.6.1.2.1.31.1.1.1.10.6'
61
+ read: 'router:1.3.6.1.2.1.31.1.1.1.10.6'
62
62
  Router_eth7_bytes_in:
63
63
  type: int_roc
64
- addr: 'router:1.3.6.1.2.1.31.1.1.1.6.7'
64
+ read: 'router:1.3.6.1.2.1.31.1.1.1.6.7'
65
65
  Router_eth7_bytes_out:
66
66
  type: int_roc
67
- addr: 'router:1.3.6.1.2.1.31.1.1.1.10.7'
67
+ read: 'router:1.3.6.1.2.1.31.1.1.1.10.7'
68
68
  Router_eth8_bytes_in:
69
69
  type: int_roc
70
- addr: 'router:1.3.6.1.2.1.31.1.1.1.6.8'
70
+ read: 'router:1.3.6.1.2.1.31.1.1.1.6.8'
71
71
  Router_eth8_bytes_out:
72
72
  type: int_roc
73
- addr: 'router:1.3.6.1.2.1.31.1.1.1.10.8'
73
+ read: 'router:1.3.6.1.2.1.31.1.1.1.10.8'
@@ -166,6 +166,46 @@ sim_DateTimeSet:
166
166
  sim_DateTimeVal:
167
167
  desc: Simulation tag
168
168
  type: int
169
+ Ani_Fin_20:
170
+ desc: 'Logix Fin[20]'
171
+ type: float
172
+ dp: 2
173
+ Ani_Fout_20:
174
+ desc: 'Logix Fout[20]'
175
+ type: float
176
+ dp: 2
177
+ Ani_Iin_20:
178
+ desc: 'Logix Iin[20]'
179
+ type: int
180
+ Ani_Iout_20:
181
+ desc: 'Logix Iout[20]'
182
+ type: int
183
+ Ani_Iout_21_0:
184
+ desc: 'Logix Iout[21].0'
185
+ multi:
186
+ - 'Off'
187
+ - 'On'
188
+ Ani_Iout_21_1:
189
+ desc: 'Logix Iout[21].1'
190
+ multi:
191
+ - 'Off'
192
+ - 'On'
193
+ Ani_Iin_21_0:
194
+ desc: 'Logix Iin[21].0'
195
+ multi:
196
+ - 'Off'
197
+ - 'On'
198
+ Ani_Iin_21_1:
199
+ desc: 'Logix Iin[21].1'
200
+ multi:
201
+ - 'Off'
202
+ - 'On'
203
+ InVar:
204
+ desc: InVar
205
+ type: float
206
+ OutVar:
207
+ desc: OutVar
208
+ type: float
169
209
  Router_eth1_bytes_in:
170
210
  desc: eth1 bytes in
171
211
  type: int
@@ -213,4 +253,13 @@ Router_eth8_bytes_in:
213
253
  type: int
214
254
  Router_eth8_bytes_out:
215
255
  desc: eth8 bytes out
216
- type: int
256
+ type: int
257
+ localhost_ping:
258
+ desc: Ping time to localhost
259
+ units: ms
260
+ google_ping:
261
+ desc: Ping time to google
262
+ units: ms
263
+ electronet_ping:
264
+ desc: Ping time to electronet
265
+ units: ms