tlms_esd 0.1.0 → 0.6.0

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.
Files changed (71) hide show
  1. package/.git-blame-ignore-revs +5 -0
  2. package/.gitattributes +9 -0
  3. package/.gitignore +41 -0
  4. package/.local/TODO.md +90 -0
  5. package/.local/data_structure2025.xlsx +0 -0
  6. package/.local/data_structure2026.xlsx +0 -0
  7. package/.local/issues/a6d39veq-actuator-emulator.md +75 -0
  8. package/.local/issues/v9xg9fxn-config-compile-entry.md +86 -0
  9. package/.local/issues/yqq38rn8-adapt-layout-data-emulator.md +74 -0
  10. package/.npmignore +18 -0
  11. package/AGENTS.md +153 -0
  12. package/CHANGELOG.md +192 -0
  13. package/cli.js +185 -263
  14. package/doc/design.md +691 -0
  15. package/doc/design.zh-cn.md +690 -0
  16. package/doc/spec-modbus.md +263 -0
  17. package/doc/spec-modbus.zh-cn.md +261 -0
  18. package/doc/spec.md +310 -0
  19. package/doc/spec.zh-cn.md +308 -0
  20. package/eslint.config.js +58 -0
  21. package/issues/yqq38rn8-adapt-layout-data-emulator.md +71 -0
  22. package/layouts.yaml +208 -0
  23. package/logs/error_2024-10-11.log +2 -0
  24. package/logs/error_2026-10-09.log +36 -0
  25. package/logs/error_2026-10-10.log +1 -0
  26. package/logs/error_2026-10-11.log +0 -0
  27. package/logs/error_2026-10-12.log +0 -0
  28. package/logs/error_2026-10-13.log +0 -0
  29. package/logs/error_2026-10-15.log +0 -0
  30. package/logs/error_2026-10-16.log +0 -0
  31. package/logs/error_2026-10-17.log +0 -0
  32. package/logs/error_2026-10-23.log +0 -0
  33. package/logs/error_2026-10-25.log +3 -0
  34. package/logs/error_2026-10-27.log +0 -0
  35. package/logs/error_2026-10-28.log +0 -0
  36. package/logs/error_2026-10-30.log +0 -0
  37. package/logs/error_2026-11-05.log +0 -0
  38. package/logs/error_2026-11-07.log +0 -0
  39. package/logs/error_2026-11-14.log +1 -0
  40. package/logs/error_2026-11-15.log +0 -0
  41. package/logs/error_2026-11-17.log +0 -0
  42. package/logs/error_2026-11-18.log +0 -0
  43. package/logs/error_2026-11-22.log +0 -0
  44. package/logs/info_2024-10-11.log +2 -0
  45. package/logs/info_2026-10-09.log +36 -0
  46. package/logs/info_2026-10-10.log +1 -0
  47. package/logs/info_2026-10-11.log +0 -0
  48. package/logs/info_2026-10-12.log +0 -0
  49. package/logs/info_2026-10-13.log +0 -0
  50. package/logs/info_2026-10-15.log +0 -0
  51. package/logs/info_2026-10-16.log +0 -0
  52. package/logs/info_2026-10-17.log +0 -0
  53. package/logs/info_2026-10-23.log +0 -0
  54. package/logs/info_2026-10-25.log +3 -0
  55. package/logs/info_2026-10-27.log +0 -0
  56. package/logs/info_2026-10-28.log +0 -0
  57. package/logs/info_2026-10-30.log +0 -0
  58. package/logs/info_2026-11-05.log +0 -0
  59. package/logs/info_2026-11-07.log +0 -0
  60. package/logs/info_2026-11-14.log +1 -0
  61. package/logs/info_2026-11-15.log +0 -0
  62. package/logs/info_2026-11-17.log +0 -0
  63. package/logs/info_2026-11-18.log +0 -0
  64. package/logs/info_2026-11-22.log +0 -0
  65. package/main.js +27852 -8191
  66. package/nodemon.json +9 -11
  67. package/package.json +24 -25
  68. package/rolldown.config.js +35 -0
  69. package/dev.js +0 -5
  70. package/emulator.js +0 -7768
  71. package/rollup.config.js +0 -41
@@ -0,0 +1,58 @@
1
+ import js from "@eslint/js";
2
+ import stylistic from "@stylistic/eslint-plugin";
3
+ import globals from "globals";
4
+
5
+ // ESLint finds code problems; @stylistic normalizes whitespace without
6
+ // re-wrapping lines, so hand-laid tables (e.g. the struct layouts) keep their layout.
7
+ export default [
8
+ // build outputs and packages installed from the yalc store
9
+ { ignores: ["main.js", "cli.js", ".yalc/"] },
10
+ js.configs.recommended,
11
+ stylistic.configs.customize({
12
+ indent: "tab",
13
+ quotes: "double",
14
+ semi: true,
15
+ jsx: false,
16
+ arrowParens: true,
17
+ braceStyle: "1tbs",
18
+ quoteProps: "consistent",
19
+ }),
20
+ {
21
+ rules: {
22
+ // Allow aligned end-of-line comments.
23
+ "@stylistic/no-multi-spaces": ["error", { ignoreEOLComments: true }],
24
+ // Allow consecutive single-line class fields.
25
+ "@stylistic/lines-between-class-members": ["error", "always", { exceptAfterSingleLine: true }],
26
+ // Allow `if (cond) { stmt; }` on one line.
27
+ "@stylistic/max-statements-per-line": ["error", { max: 2 }],
28
+ // Continuation lines of binary expressions are left to the author.
29
+ "@stylistic/indent-binary-ops": "off",
30
+ // Line breaks inside lists are left to the author (hand-laid tables).
31
+ "@stylistic/list-style": "off",
32
+ // Parameters prefixed with `_` are unused on purpose.
33
+ "no-unused-vars": ["error", { argsIgnorePattern: "^_" }],
34
+ // layout-data is used through modbus-emulator, which forwards its API: one copy in the process.
35
+ // It is a dev dependency only for its layout-types command (pnpm gen:types).
36
+ "no-restricted-imports": ["error", {
37
+ paths: [{ name: "layout-data", message: "Import it from modbus-emulator, which forwards the API." }],
38
+ patterns: [{ group: ["layout-data/*"], message: "Use the layout-types command of layout-data, not its modules." }],
39
+ }],
40
+ // Use the Number namespace instead of the equivalent globals.
41
+ "no-restricted-globals": ["error",
42
+ { name: "Infinity", message: "Use Number.POSITIVE_INFINITY." },
43
+ { name: "NaN", message: "Use Number.NaN." },
44
+ { name: "isNaN", message: "Use Number.isNaN." },
45
+ { name: "isFinite", message: "Use Number.isFinite." },
46
+ { name: "parseInt", message: "Use Number.parseInt." },
47
+ { name: "parseFloat", message: "Use Number.parseFloat." },
48
+ ],
49
+ },
50
+ },
51
+ {
52
+ languageOptions: {
53
+ ecmaVersion: "latest",
54
+ sourceType: "module",
55
+ globals: globals.node,
56
+ },
57
+ },
58
+ ];
@@ -0,0 +1,71 @@
1
+ ---
2
+ id: yqq38rn8
3
+ opened: 2026-10-29T16:59:59.000Z
4
+ closed: 2026-11-14T07:04:08.981Z
5
+ title: Adapt to layout-data 0.6.0, modbus-emulator 0.3.0 and es-modbus 0.3.0
6
+ status: fixed # open | accepted | fixed | rejected | wontfix
7
+ labels: []
8
+ remote:
9
+ ---
10
+
11
+ ## Problem
12
+
13
+ The dependencies layout-data, modbus-emulator and es-modbus changed their interfaces one after another, and this project has to follow.
14
+
15
+ - layout-data 0.5.0 introduces layout scopes: layouts are registered in a scope, and there is no global registry; the layout description now lists the layout names under `layouts` and holds the item tables under `item_tables`; the byte map is provided by `Layout#io_index_table`; type generation becomes its development tool `layout-types`, which modbus-emulator does not forward.
16
+ - layout-data 0.6.0: `yaml_file` is renamed `desc_file`; the scope's `register_layout` is replaced by `scope.load(descriptions)`, which creates the Ldata of the data blocks in the description while registering the layouts, and block names must be unique within a layout.
17
+ - modbus-emulator 0.2.0: the constructor only accepts a scope name, `new Modbus_Emulator(scope)`; descriptions are loaded by `emulator.load(paths)`, which may be called several times, and each call either succeeds completely or changes nothing; `load` only accepts paths of description files and no longer accepts descriptions as objects; the `warnings` array of the constructor becomes the `warning` event; `stop()` gives the block names back to the layouts.
18
+ - modbus-emulator 0.3.0 (depends on es-modbus 0.3.0):
19
+ - Blocks are placed by unit entries: the description gets the root key `units`, and block entries keep only `name` and `layout`, no longer taking `unit_id`, `start` and `offset` (an extra key is an error); a unit entry stands for a device and uses `blocks` to place blocks of its own description at `start` of the unit; every block of a description must be placed by some unit, and only once, and a unit id may be declared by one unit entry only.
20
+ - Unit entries get the optional `endian` (`BE` by default), `unmapped_read` (`zero` by default) and `unmapped_write` (`ignore` by default), and placements get the optional `readonly` (`none` by default); with the defaults the behavior is the same as in 0.2.0.
21
+ - `Unit_Map#attach_unit(unit_id, block, start, offset)` becomes `attach_unit(unit_id, block, { start, offset, readonly })`.
22
+ - The `unmapped` event is emitted only for requests that succeed and carries `operation` (`read` or `write`); the events `request_refused` / `request_refused_limit` are added for refused requests.
23
+ - A TCP port is from 1 to 65535; port 0 is rejected.
24
+ - es-modbus 0.3.0 (compared with 0.3.0-beta.4): `Modbus_Client` takes a single options object, in which exactly one of `tcp`, `rtu_over_tcp` and `serial` selects the transport, its value being the target, e.g. `new Modbus_Client({ tcp: "10.0.0.5:502" })`; the constructor parameter `address` and the options `port` and `rtu` are removed; an option that does not apply to the selected transport throws; an IPv6 host in `host:port` must be bracketed, and port 0 is not accepted.
25
+
26
+ This project used to have `create_upward` assemble a description as an object in memory and pass it to the emulator, relying on an unpublished entry point of the emulator (marked with `@ts-expect-error` in the code). With that entry point removed, the emulator cannot be constructed. After updating the dependencies to their latest versions, every test file fails while loading.
27
+
28
+ Adapting only to modbus-emulator 0.2.0 and es-modbus 0.3.0-beta.4, updating the dependencies further to their latest versions also gives these failures:
29
+
30
+ - The generated description writes `unit_id` and `start` in the block entries; modbus-emulator 0.3.0 reports an error when loading it, and the controller cannot start.
31
+ - `MTClient` constructs its client with `new Modbus_Client(host, { port, rtu, ... })`; the host string is not an options object, so es-modbus 0.3.0 throws at construction, and Modbus TCP actuators cannot be connected.
32
+ - The tests place the command block with `attach_unit(UNIT, block, 400)`; the third argument is not an options object, so the command block is placed at byte 0, overlapping the data block, which is an error.
33
+
34
+ ## Proposal
35
+
36
+ Adapt directly to layout-data 0.6.0 and the new emulator interface, without a separate adaptation to layout-data 0.5.0: modbus-emulator will not publish a version adapted to 0.5.0, so a commit adapting only to 0.5.0 could not depend on published packages.
37
+
38
+ Layouts and scope:
39
+
40
+ - The controller layouts are registered in the scope `tlms` (`LAYOUT_SCOPE`); layouts are taken from the scope, and the Ldata of the data blocks are created when the scope loads the description.
41
+ - `layouts.yaml` uses the new description format; the names, types, offsets and initial values of all layout items stay the same, and the register map is unchanged.
42
+ - The byte map of the IO bindings is taken from the layout (`Layout#io_index_table`).
43
+ - `layout-data` is a development dependency at the version modbus-emulator depends on; `gen:types` uses `layout-types`.
44
+
45
+ Dependency versions: modbus-emulator `^0.3.0`; es-modbus `^0.3.0`, matching the 0.3.0 that modbus-emulator depends on, so the process and the bundle hold one copy; layout-data stays at 0.6.0.
46
+
47
+ Emulator description: the controller generates the emulator description as a file, and the emulator then loads that file.
48
+
49
+ - The files of the emulator are kept in a subdirectory of the configuration directory named after the controller, and the description file is `emulator.yaml` in it (`<controller name>/emulator.yaml`), regenerated at every start; reading the configuration reads only the top level of the configuration directory, not its subdirectories, so the description file needs no exclusion by name. Future emulator implementations of the actuators produce their description files the same way: in a subdirectory named after the actuator. The file inlines the layouts of `layouts.yaml` and, together with `blocks`, `units` and `servers`, is a complete description: an operator who opens it sees every data block and server of the emulator.
50
+ - Following the format of modbus-emulator 0.3.0, the description is split into blocks and units: block entries give only `name` and `layout`; the unit ids are taken from `controller.modbus_server.unit_id`, with one unit entry per unit id that places the blocks of that unit: the blocks of the action records, the lines and the sections at byte 0, and the data of an actuator at byte 0 and its command at byte 400. The `endian`, `unmapped_read` and `unmapped_write` of the units and the `readonly` of the placements keep their defaults, so the upward register map and response behavior are unchanged.
51
+ - The description has no root key `scope`: the scope is chosen in code (`new Modbus_Emulator(LAYOUT_SCOPE)`) and the emulator does not read the key, so writing it in the file would mislead the operator into thinking the description chooses the scope.
52
+ - Block names are determined when the object graph is built and stored on the objects: the block name of a line, section or node is the object's `name`, and the command block name and the record block name are stored in dedicated fields. Block names are kept apart from the Ldata instances; a name is never stored first and then overwritten with the instance.
53
+ - Generating the description is a pure function of the read-only object graph. A main orchestration function builds the object graph, generates and writes the description file, constructs the emulator and loads the description, and mounts the Ldata instances on the object graph (`data`, `command` and the record block), in that order; `main.js` and the tests share it. `build_runtime` uses the mounted instances directly and no longer receives the emulator.
54
+ - The tests write the description file to a temporary directory; the tests' own layouts are registered with `desc_file` and `scope.load`.
55
+ - The `unmapped` event of the emulator is logged with its `operation`.
56
+ - Tests that place blocks with `Unit_Map` directly use the options object, `attach_unit(unit_id, block, { start })`.
57
+
58
+ Modbus TCP client: `MTClient` constructs the es-modbus client with `{ tcp: "<host>:<port>", reconnect_time, reconnect_max }` and no longer passes `rtu`; an IPv6 host is bracketed. The meaning and defaults of `host` and `port` in the configuration are unchanged.
59
+
60
+ The descriptions of the upward server (§4.4) and of MTClient (§4.2) in `doc/design.md` are updated accordingly.
61
+
62
+ Rejected approaches:
63
+
64
+ - Keep passing the description as an in-memory object: it relies on an internal entry point of the emulator, which has been removed.
65
+ - Generate the description text at run time with `yaml(JSON.stringify(...))` without writing a file: it works, but the operator cannot see what the emulator actually loaded.
66
+ - Make modbus-emulator's `load` also accept objects: the description file is useful to the operator in itself, and there is no need to widen the emulator's interface for this project.
67
+ - Use this adaptation to set a unit byte order, read-only points or the refusal of unmapped addresses on the upward server: it would change the protocol behavior the HMI sees, which is not part of an adaptation; open a separate issue when needed.
68
+
69
+ ## Decision
70
+
71
+ Accepted. The new versions of the dependencies no longer support the old way of construction, so the adaptation is required; the generated description file also lets the operator see the emulator's data blocks and servers. Implement as proposed.
package/layouts.yaml ADDED
@@ -0,0 +1,208 @@
1
+ # Data block layouts of the controller (doc/spec.md 3.6, doc/design-scan.md 2.1).
2
+ # These layouts are the memory images of the actuator data / command areas and
3
+ # the HMI register map: changing an offset is a protocol change.
4
+ #
5
+ # `layouts` lists the layouts; `item_tables` holds the item tables: the
6
+ # layouts and the fragments referenced by name from `coupling` and
7
+ # `includes`. Offsets and lengths are in bits; `length` is omitted where it
8
+ # follows from the type. Coupled bits are listed from the high byte (offsets
9
+ # 8..15 are register bits 0..7, offsets 0..7 bits 8..15).
10
+
11
+ layouts: [LINE, SECTION, NODE, COMMAND, RECORD]
12
+
13
+ item_tables:
14
+ node_commands: # bits of a command word
15
+ - { name: stop_pumps, type: Bool, offset: 8, init_value: false, comment: "Stop pump command" }
16
+ - { name: cancel_stop, type: Bool, offset: 9, init_value: false, comment: "Cancel stop pump" }
17
+ - { name: horn, type: Bool, offset: 10, init_value: false, comment: "Output alarm" }
18
+ - { name: reset_horn, type: Bool, offset: 11, init_value: false, comment: "Stop alarm" }
19
+ - { name: enable_pressure_SD, type: Bool, offset: 12, init_value: false, comment: "Set pressure linked pump stop" }
20
+ - { name: disable_pressure_SD, type: Bool, offset: 13, init_value: false, comment: "Cancel pressure linked pump stop" }
21
+ - { name: read_paras, type: Bool, offset: 14, init_value: false, comment: "Read all parameters" }
22
+ - { name: write_paras, type: Bool, offset: 15, init_value: false, comment: "Write parameter command" }
23
+ - { name: enable_pressure_alarm, type: Bool, offset: 0, init_value: false, comment: "Allow pressure alarm" }
24
+ - { name: disable_pressure_alarm, type: Bool, offset: 1, init_value: false, comment: "Disable pressure alarm" }
25
+ - { name: enable, type: Bool, offset: 2, init_value: false, comment: "Allow the node to work" }
26
+ - { name: disable, type: Bool, offset: 3, init_value: false, comment: "Disable the node" }
27
+ - { name: reset_CPU, type: Bool, offset: 4, init_value: false, comment: "Reset CPU" }
28
+ - { name: reset_conn, type: Bool, offset: 5, init_value: false, comment: "Reset connection" }
29
+ - { name: reserve, type: Bool, offset: 6, init_value: false, comment: "Reserve" }
30
+ - { name: executing, type: Bool, offset: 7, init_value: false, comment: "Executing" }
31
+
32
+ node_parameters: # parameter block of a node
33
+ - { name: temperature_zero_raw, type: Int, offset: 0, init_value: 0, comment: "Raw temperature zero point" }
34
+ - { name: temperature_span_raw, type: Int, offset: 16, init_value: 27648, comment: "Raw temperature range" }
35
+ - { name: temperature_underflow, type: Int, offset: 32, init_value: -500, comment: "Temperature underflow setting value" }
36
+ - { name: temperature_overflow, type: Int, offset: 48, init_value: 28000, comment: "Temperature overflow setting value" }
37
+ - { name: temperature_zero, type: Real, offset: 64, init_value: 0, comment: "Temperature zero point" }
38
+ - { name: temperature_span, type: Real, offset: 96, init_value: 100, comment: "Temperature range" }
39
+ - { name: temperature_AH, type: Real, offset: 128, init_value: 0, comment: "Temperature AH value" }
40
+ - { name: temperature_WH, type: Real, offset: 160, init_value: 0, comment: "Temperature WH value" }
41
+ - { name: temperature_WL, type: Real, offset: 192, init_value: 0, comment: "Temperature WL value" }
42
+ - { name: temperature_AL, type: Real, offset: 224, init_value: 0, comment: "Temperature AL value" }
43
+ - { name: temperature_DZ, type: Real, offset: 256, init_value: 0.5, comment: "Temperature comparison dead zone" }
44
+ - { name: temperature_FT, type: UDInt, offset: 288, init_value: 0, comment: "Temperature comparison fault tolerance time" }
45
+ - { name: pressure_zero_raw, type: Int, offset: 320, init_value: 0, comment: "Raw pressure zero point" }
46
+ - { name: pressure_span_raw, type: Int, offset: 336, init_value: 27648, comment: "Raw pressure range" }
47
+ - { name: pressure_underflow, type: Int, offset: 352, init_value: -500, comment: "Pressure underflow setting value" }
48
+ - { name: pressure_overflow, type: Int, offset: 368, init_value: 28000, comment: "Pressure overflow setting value" }
49
+ - { name: pressure_zero, type: Real, offset: 384, init_value: 0, comment: "Pressure zero point" }
50
+ - { name: pressure_span, type: Real, offset: 416, init_value: 4, comment: "Pressure range" }
51
+ - { name: pressure_AH, type: Real, offset: 448, init_value: 0, comment: "Pressure AH value" }
52
+ - { name: pressure_WH, type: Real, offset: 480, init_value: 0, comment: "Pressure WH value" }
53
+ - { name: pressure_WL, type: Real, offset: 512, init_value: 0, comment: "Pressure WL value" }
54
+ - { name: pressure_AL, type: Real, offset: 544, init_value: 0, comment: "Pressure AL value" }
55
+ - { name: pressure_DZ, type: Real, offset: 576, init_value: 0.05, comment: "Pressure comparison dead zone" }
56
+ - { name: pressure_FT, type: UDInt, offset: 608, init_value: 0, comment: "Pressure comparison fault tolerance time" }
57
+ - { name: reserve1, type: Real, offset: 640, init_value: 0, comment: "Reserve 1" }
58
+ - { name: reserve2, type: Real, offset: 672, init_value: 0, comment: "Reserve 2" }
59
+ - { name: reserve3, type: Real, offset: 704, init_value: 0, comment: "Reserve 3" }
60
+ - { name: invalid_value_of_AI, type: Real, offset: 736, init_value: -100000, comment: "Value when AI is invalid" }
61
+ - { name: delay_protect_time, type: UDInt, offset: 768, init_value: 5000, comment: "Communication interrupt delay protection time" }
62
+ - { name: flow_smooth_factor, type: Real, offset: 800, init_value: 0.9, comment: "Flow smoothing factor" }
63
+ - { name: flow1_k_factor, type: DInt, offset: 832, init_value: 10000, comment: "Flow 1 K-factor (pulses/m3)" }
64
+ - { name: flow2_k_factor, type: DInt, offset: 864, init_value: 10000, comment: "Flow 2 K-factor (pulses/m3)" }
65
+ - { name: flow3_k_factor, type: DInt, offset: 896, init_value: 10000, comment: "Flow 3 K-factor (pulses/m3)" }
66
+ - { name: flow4_k_factor, type: DInt, offset: 928, init_value: 10000, comment: "Flow 4 K-factor (pulses/m3)" }
67
+ - { name: flow5_k_factor, type: DInt, offset: 960, init_value: 10000, comment: "Flow 5 K-factor (pulses/m3)" }
68
+ - { name: pump_change_delay, type: UDInt, offset: 992, init_value: 180000, comment: "Pump operation delay" }
69
+
70
+ node_status: # status word of a node
71
+ - { name: comm_OK, type: Bool, offset: 8, init_value: true, comment: "Used to maintain node communication status" }
72
+ - { name: work_OK, type: Bool, offset: 9, init_value: true, comment: "Used to maintain node work status" }
73
+ - { name: pump_run, type: Bool, offset: 10, init_value: false, comment: "Is the pump running in this node?" }
74
+ - { name: pump_change_F, type: Bool, offset: 11, init_value: false, comment: "Whether the pump is in the delay of operation on this node" }
75
+ - { name: pump_run_1, type: Bool, offset: 12, init_value: false, comment: "Running status of pump 1" }
76
+ - { name: pump_run_2, type: Bool, offset: 13, init_value: false, comment: "Running status of pump 2" }
77
+ - { name: pump_run_3, type: Bool, offset: 14, init_value: false, comment: "Running status of pump 3" }
78
+ - { name: pump_run_4, type: Bool, offset: 15, init_value: false, comment: "Running status of pump 4" }
79
+ - { name: pressure_enabled, type: Bool, offset: 0, init_value: false, comment: "Whether pressure alarm is enabled" }
80
+ - { name: temperature_enabled, type: Bool, offset: 1, init_value: false, comment: "Whether temperature alarm is enabled" }
81
+ - { name: pressure_SD_F, type: Bool, offset: 2, init_value: false, comment: "Whether pressure linked to stop pump is enabled" }
82
+ - { name: delay_protect, type: Bool, offset: 3, init_value: true, comment: "Whether communication interrupt delay protection is enabled" }
83
+ - { name: pressure_AH_F, type: Bool, offset: 4, init_value: false, comment: "Whether pressure AH limit alarm is enabled" }
84
+ - { name: pressure_WH_F, type: Bool, offset: 5, init_value: false, comment: "Whether pressure WH limit alarm is enabled" }
85
+ - { name: pressure_WL_F, type: Bool, offset: 6, init_value: false, comment: "Whether pressure WL limit alarm is enabled" }
86
+ - { name: pressure_AL_F, type: Bool, offset: 7, init_value: false, comment: "Whether pressure AL limit alarm is enabled" }
87
+
88
+ section_status: # status word of a section
89
+ - { name: comm_OK, type: Bool, offset: 8, init_value: false, comment: "Whether all nodes in this section communicate normally" }
90
+ - { name: work_OK, type: Bool, offset: 9, init_value: false, comment: "Whether all nodes in this section work normally" }
91
+ - { name: protect_F, type: Bool, offset: 10, init_value: false, comment: "Whether this section is in protective mode" }
92
+ - { name: hangon_AF, type: Bool, offset: 11, init_value: false, comment: "Whether this section is automatically hung up" }
93
+ - { name: flow_override, type: Bool, offset: 12, init_value: false, comment: "Whether this section is manually hung up" }
94
+ - { name: action_F, type: Bool, offset: 13, init_value: false, comment: "Whether this section is in the action of stopping the pump due to leakage" }
95
+ - { name: flow_warning_F, type: Bool, offset: 14, init_value: false, comment: "Whether this section is in the flow warning status" }
96
+ - { name: flow_alarm_F, type: Bool, offset: 15, init_value: false, comment: "Whether this section is in the flow alarm status" }
97
+ - { name: press_warning_F, type: Bool, offset: 0, init_value: false, comment: "Whether this section is in the pressure warning status" }
98
+ - { name: press_alarm_F, type: Bool, offset: 1, init_value: false, comment: "Whether this section is in the pressure alarm status" }
99
+ - { name: auto_stop_cmd, type: Bool, offset: 2, init_value: false, comment: "Whether this section is in the auto stop status" }
100
+ - { name: man_stop_cmd, type: Bool, offset: 3, init_value: false, comment: "Whether this section is in the manual stop status" }
101
+ - { name: line_action_source, type: Bool, offset: 4, init_value: false, comment: "Whether this section is the source of the line action" }
102
+ - { name: pump_run, type: Bool, offset: 5, init_value: false, comment: "Whether this section has an open pump" }
103
+ - { name: pump_change_F, type: Bool, offset: 6, init_value: false, comment: "Whether there is a pump operation in the current time period" }
104
+ - { name: pre_stop_notice, type: Bool, offset: 7, init_value: false, comment: "Whether this section is in the pre-stop status" }
105
+
106
+ LINE:
107
+ - name: status
108
+ type: Word
109
+ offset: 0
110
+ comment: "status word"
111
+ is_combined: true
112
+ coupling:
113
+ - { name: flow_override, type: Bool, offset: 8, init_value: false, comment: "Manual hang-up of the whole line" }
114
+ - { name: pump_run, type: Bool, offset: 9, init_value: false, comment: "Whether this line pumps" }
115
+ - { name: alarm_F, type: Bool, offset: 10, init_value: false, comment: "Whether this line alarms" }
116
+ - { name: auto_stop_cmd, type: Bool, offset: 11, init_value: false, comment: "Auto stop command" }
117
+ - { name: man_stop_cmd, type: Bool, offset: 12, init_value: false, comment: "Manual stop command" }
118
+ - { name: pre_stop_notice, type: Bool, offset: 13, init_value: false, comment: "Stop notice" }
119
+ - { name: ID, type: UInt, offset: 16, init_value: 0, comment: "Line ID" }
120
+ - { name: action_section_ID, type: UInt, offset: 32, init_value: 0, comment: "Section ID of the flow difference action" }
121
+ - { name: flow_diff, type: Real, offset: 48, init_value: 0, comment: "Flow difference bypass (reserved, not implemented)" }
122
+ SECTION:
123
+ - { name: ID, type: UInt, offset: 0, init_value: 0, comment: "Section ID" }
124
+ - { name: upward_input, type: Word, offset: 16, init_value: 0, comment: "Upward input area, writable by the upward clients (reserved)" }
125
+ - name: status
126
+ type: Word
127
+ offset: 32
128
+ comment: "status word"
129
+ is_combined: true
130
+ coupling: section_status
131
+ - { name: flow_begin, type: Real, offset: 48, init_value: 0, comment: "Total flow of the starting node" }
132
+ - { name: flow_end, type: Real, offset: 80, init_value: 0, comment: "Total flow of the ending node" }
133
+ - { name: flow_diff, type: Real, offset: 112, init_value: 0, comment: "Flow difference" }
134
+ - { name: flow_diff_WH, type: Real, offset: 144, init_value: 20, comment: "Flow warning difference upper limit" }
135
+ - { name: flow_diff_WH_delay, type: DInt, offset: 176, init_value: 3000, comment: "Flow warning tolerance time (in milliseconds)" }
136
+ - { name: flow_diff_AH, type: Real, offset: 208, init_value: 50, comment: "Flow difference alarm upper limit" }
137
+ - { name: flow_diff_AH_delay, type: DInt, offset: 240, init_value: 3000, comment: "Flow alarm tolerance time (in milliseconds)" }
138
+ - { name: action_time, type: DInt, offset: 272, init_value: 60000, comment: "Linked action time (in milliseconds)" }
139
+ - { name: countdown, type: Int, offset: 304, init_value: 0, comment: "Linked action countdown (in seconds)" }
140
+ NODE:
141
+ - { name: ID, type: UInt, offset: 0, init_value: 0 }
142
+ - name: status
143
+ type: Word
144
+ offset: 16
145
+ comment: "the status of the node"
146
+ is_combined: true
147
+ coupling: node_status
148
+ - { name: temperature, type: Real, offset: 32, init_value: 0 }
149
+ - { name: pressure, type: Real, offset: 64, init_value: 0 }
150
+ - { name: flowmeter, type: Real, offset: 96, init_value: 0 }
151
+ - name: response_code
152
+ type: Word
153
+ offset: 128
154
+ comment: "Execution response"
155
+ is_combined: true
156
+ coupling: node_commands
157
+ - { includes: node_parameters, offset: 144 }
158
+ COMMAND:
159
+ - { name: response_code, type: Word, offset: 0, init_value: 0, comment: "No longer used" }
160
+ - { name: overtime, type: Int, offset: 16, init_value: 5000, comment: "Response timeout setting (milliseconds) No longer used" }
161
+ - name: extra_commands
162
+ type: Word
163
+ offset: 48
164
+ comment: "Extended commands"
165
+ is_combined: true
166
+ coupling:
167
+ - { name: has_commands, type: Bool, offset: 8, init_value: false, comment: "Whether there are commands to be sent" }
168
+ - { name: reset_paras, type: Bool, offset: 9, init_value: false, comment: "Reset the parameter values to the node parameter values" }
169
+ - { name: ID, type: UInt, offset: 128, init_value: 0, comment: "Node ID" }
170
+ - name: commands
171
+ type: Word
172
+ offset: 144
173
+ comment: "Commands"
174
+ is_combined: true
175
+ coupling: node_commands
176
+ - { includes: node_parameters, offset: 160 }
177
+ RECORD:
178
+ - { name: year, type: Uint, offset: 0, init_value: 0, comment: "Year" }
179
+ - { name: month, type: Uint, offset: 16, init_value: 0, comment: "Month" }
180
+ - { name: day, type: Uint, offset: 32, init_value: 0, comment: "Day" }
181
+ - { name: hour, type: Uint, offset: 48, init_value: 0, comment: "Hour" }
182
+ - { name: minute, type: Uint, offset: 64, init_value: 0, comment: "Minute" }
183
+ - { name: second, type: Uint, offset: 80, init_value: 0, comment: "Second" }
184
+ - { name: section_ID, type: UInt, offset: 96, init_value: 0, comment: "Section ID for action, 0 for no record" }
185
+ - { name: flow_begin, type: Real, offset: 112, init_value: 0, comment: "Flow sum of the start node of the action section" }
186
+ - { name: flow_end, type: Real, offset: 144, init_value: 0, comment: "Flow sum of the end node of the action section" }
187
+ - { name: flow_diff, type: Real, offset: 176, init_value: 0, comment: "Flow difference of the action section" }
188
+ - { name: node1_press, type: Real, offset: 208, init_value: 0, comment: "Pressure of node 1 of the action section" }
189
+ - { name: node2_press, type: Real, offset: 240, init_value: 0, comment: "Pressure of node 2 of the action section" }
190
+ - { name: node3_press, type: Real, offset: 272, init_value: 0, comment: "Pressure of node 3 of the action section" }
191
+ - { name: node4_press, type: Real, offset: 304, init_value: 0, comment: "Pressure of node 4 of the action section" }
192
+ - { name: node1_ID, type: UInt, offset: 336, init_value: 0, comment: "Node 1 ID of the action section" }
193
+ - { name: node2_ID, type: UInt, offset: 352, init_value: 0, comment: "Node 2 ID of the action section" }
194
+ - { name: node3_ID, type: UInt, offset: 368, init_value: 0, comment: "Node 3 ID of the action section" }
195
+ - { name: node4_ID, type: UInt, offset: 384, init_value: 0, comment: "Node 4 ID of the action section" }
196
+ - name: status
197
+ type: Word
198
+ offset: 400
199
+ comment: "status"
200
+ is_combined: true
201
+ coupling:
202
+ - { name: press_action, type: Bool, offset: 8, init_value: false, comment: "Pressure exceeds the limit and takes action" }
203
+ - { name: flow_action, type: Bool, offset: 9, init_value: false, comment: "Flow difference exceeds the limit and takes action" }
204
+ - { name: node1_pump_run, type: Bool, offset: 10, init_value: false, comment: "Node 1 of the action section has an open pump" }
205
+ - { name: node2_pump_run, type: Bool, offset: 11, init_value: false, comment: "Node 2 of the action section has an open pump" }
206
+ - { name: node3_pump_run, type: Bool, offset: 12, init_value: false, comment: "Node 3 of the action section has an open pump" }
207
+ - { name: node4_pump_run, type: Bool, offset: 13, init_value: false, comment: "Node 4 of the action section has an open pump" }
208
+ - { name: index, type: Int, offset: 416, init_value: -1, comment: "The reverse order of the record, 0 for the latest" }
@@ -0,0 +1,2 @@
1
+ 2024-10-11 17:18:24.921 [INFO] - read D:\codes\AS\TLMS_ESD.js/pnpm-lock.yaml
2
+ 2024-10-11 17:18:24.926 [ERROR] - Controller undefined not found!
@@ -0,0 +1,36 @@
1
+ 2026-10-09 20:25:44.623 [INFO] - ModbusTCP server listening on modbus://127.0.0.1:15020
2
+ 2026-10-09 20:25:44.626 [INFO] - client connected: 127.0.0.1:53603
3
+ 2026-10-09 20:25:44.626 [INFO] - connected to modbus://127.0.0.1:15020!
4
+ 2026-10-09 20:25:44.693 [ERROR] - invalid read on modbus://127.0.0.1:15020 unit 300: Invalid unit ID: 300
5
+ 2026-10-09 20:25:44.693 [ERROR] - invalid write on modbus://127.0.0.1:15020 unit 300: Invalid unit ID: 300
6
+ 2026-10-09 20:33:20.449 [INFO] - ModbusTCP server listening on modbus://127.0.0.1:15021
7
+ 2026-10-09 20:33:20.453 [INFO] - client connected: 127.0.0.1:55973
8
+ 2026-10-09 20:33:20.453 [INFO] - connected to modbus://127.0.0.1:15021!
9
+ 2026-10-09 20:42:32.360 [INFO] - ModbusTCP server listening on modbus://127.0.0.1:15020
10
+ 2026-10-09 20:42:32.364 [INFO] - client connected: 127.0.0.1:62847
11
+ 2026-10-09 20:42:32.364 [INFO] - connected to modbus://127.0.0.1:15020!
12
+ 2026-10-09 20:42:32.428 [ERROR] - invalid read on modbus://127.0.0.1:15020 unit 300: Invalid unit ID: 300
13
+ 2026-10-09 20:42:32.428 [ERROR] - invalid write on modbus://127.0.0.1:15020 unit 300: Invalid unit ID: 300
14
+ 2026-10-09 20:42:32.682 [INFO] - ModbusTCP server listening on modbus://127.0.0.1:15021
15
+ 2026-10-09 20:42:32.685 [INFO] - client connected: 127.0.0.1:62848
16
+ 2026-10-09 20:42:32.685 [INFO] - connected to modbus://127.0.0.1:15021!
17
+ 2026-10-09 20:42:41.033 [INFO] - ModbusTCP server listening on modbus://127.0.0.1:15022
18
+ 2026-10-09 20:42:41.037 [INFO] - client connected: 127.0.0.1:59591
19
+ 2026-10-09 20:42:41.037 [INFO] - connected to modbus://127.0.0.1:15022!
20
+ 2026-10-09 20:49:45.701 [INFO] - ModbusTCP server listening on modbus://127.0.0.1:15023
21
+ 2026-10-09 20:49:45.704 [INFO] - client connected: 127.0.0.1:59282
22
+ 2026-10-09 20:49:45.704 [INFO] - connected to modbus://127.0.0.1:15023!
23
+ 2026-10-09 20:49:45.705 [ERROR] - client disconnected: 127.0.0.1:59282
24
+ 2026-10-09 20:49:45.915 [INFO] - client connected: 127.0.0.1:59283
25
+ 2026-10-09 20:49:45.916 [INFO] - connected to modbus://127.0.0.1:15023!
26
+ 2026-10-09 20:49:59.971 [INFO] - ModbusTCP server listening on modbus://127.0.0.1:15020
27
+ 2026-10-09 20:49:59.974 [INFO] - client connected: 127.0.0.1:59292
28
+ 2026-10-09 20:49:59.974 [INFO] - connected to modbus://127.0.0.1:15020!
29
+ 2026-10-09 20:50:00.040 [ERROR] - invalid read on modbus://127.0.0.1:15020 unit 300: Invalid unit ID: 300
30
+ 2026-10-09 20:50:00.041 [ERROR] - invalid write on modbus://127.0.0.1:15020 unit 300: Invalid unit ID: 300
31
+ 2026-10-09 20:50:00.296 [INFO] - ModbusTCP server listening on modbus://127.0.0.1:15021
32
+ 2026-10-09 20:50:00.299 [INFO] - client connected: 127.0.0.1:59293
33
+ 2026-10-09 20:50:00.299 [INFO] - connected to modbus://127.0.0.1:15021!
34
+ 2026-10-09 20:50:00.571 [INFO] - ModbusTCP server listening on modbus://127.0.0.1:15022
35
+ 2026-10-09 20:50:00.574 [INFO] - client connected: 127.0.0.1:59294
36
+ 2026-10-09 20:50:00.575 [INFO] - connected to modbus://127.0.0.1:15022!
@@ -0,0 +1 @@
1
+ 2026-10-10 15:30:20.958 [ERROR] - section S1: pressure alarm arrived
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -0,0 +1,3 @@
1
+ 2026-10-25 03:57:56.318 [INFO] - connected to modbus://127.0.0.1:502!
2
+ 2026-10-25 04:09:03.633 [INFO] - connected to modbus://127.0.0.1:502!
3
+ 2026-10-25 06:10:21.360 [INFO] - connected to modbus://127.0.0.1:502!
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -0,0 +1 @@
1
+ 2026-11-14 15:02:50.739 [INFO] - read C:/Users/goosy/AppData/Local/Temp/tmp.JkoN2BmtuV/system.yaml
File without changes
File without changes
File without changes
File without changes
@@ -0,0 +1,2 @@
1
+ 2024-10-11 17:18:24.921 [INFO] - read D:\codes\AS\TLMS_ESD.js/pnpm-lock.yaml
2
+ 2024-10-11 17:18:24.926 [ERROR] - Controller undefined not found!
@@ -0,0 +1,36 @@
1
+ 2026-10-09 20:25:44.623 [INFO] - ModbusTCP server listening on modbus://127.0.0.1:15020
2
+ 2026-10-09 20:25:44.626 [INFO] - client connected: 127.0.0.1:53603
3
+ 2026-10-09 20:25:44.626 [INFO] - connected to modbus://127.0.0.1:15020!
4
+ 2026-10-09 20:25:44.693 [ERROR] - invalid read on modbus://127.0.0.1:15020 unit 300: Invalid unit ID: 300
5
+ 2026-10-09 20:25:44.693 [ERROR] - invalid write on modbus://127.0.0.1:15020 unit 300: Invalid unit ID: 300
6
+ 2026-10-09 20:33:20.449 [INFO] - ModbusTCP server listening on modbus://127.0.0.1:15021
7
+ 2026-10-09 20:33:20.453 [INFO] - client connected: 127.0.0.1:55973
8
+ 2026-10-09 20:33:20.453 [INFO] - connected to modbus://127.0.0.1:15021!
9
+ 2026-10-09 20:42:32.360 [INFO] - ModbusTCP server listening on modbus://127.0.0.1:15020
10
+ 2026-10-09 20:42:32.364 [INFO] - client connected: 127.0.0.1:62847
11
+ 2026-10-09 20:42:32.364 [INFO] - connected to modbus://127.0.0.1:15020!
12
+ 2026-10-09 20:42:32.428 [ERROR] - invalid read on modbus://127.0.0.1:15020 unit 300: Invalid unit ID: 300
13
+ 2026-10-09 20:42:32.428 [ERROR] - invalid write on modbus://127.0.0.1:15020 unit 300: Invalid unit ID: 300
14
+ 2026-10-09 20:42:32.682 [INFO] - ModbusTCP server listening on modbus://127.0.0.1:15021
15
+ 2026-10-09 20:42:32.685 [INFO] - client connected: 127.0.0.1:62848
16
+ 2026-10-09 20:42:32.685 [INFO] - connected to modbus://127.0.0.1:15021!
17
+ 2026-10-09 20:42:41.033 [INFO] - ModbusTCP server listening on modbus://127.0.0.1:15022
18
+ 2026-10-09 20:42:41.037 [INFO] - client connected: 127.0.0.1:59591
19
+ 2026-10-09 20:42:41.037 [INFO] - connected to modbus://127.0.0.1:15022!
20
+ 2026-10-09 20:49:45.701 [INFO] - ModbusTCP server listening on modbus://127.0.0.1:15023
21
+ 2026-10-09 20:49:45.704 [INFO] - client connected: 127.0.0.1:59282
22
+ 2026-10-09 20:49:45.704 [INFO] - connected to modbus://127.0.0.1:15023!
23
+ 2026-10-09 20:49:45.705 [ERROR] - client disconnected: 127.0.0.1:59282
24
+ 2026-10-09 20:49:45.915 [INFO] - client connected: 127.0.0.1:59283
25
+ 2026-10-09 20:49:45.916 [INFO] - connected to modbus://127.0.0.1:15023!
26
+ 2026-10-09 20:49:59.971 [INFO] - ModbusTCP server listening on modbus://127.0.0.1:15020
27
+ 2026-10-09 20:49:59.974 [INFO] - client connected: 127.0.0.1:59292
28
+ 2026-10-09 20:49:59.974 [INFO] - connected to modbus://127.0.0.1:15020!
29
+ 2026-10-09 20:50:00.040 [ERROR] - invalid read on modbus://127.0.0.1:15020 unit 300: Invalid unit ID: 300
30
+ 2026-10-09 20:50:00.041 [ERROR] - invalid write on modbus://127.0.0.1:15020 unit 300: Invalid unit ID: 300
31
+ 2026-10-09 20:50:00.296 [INFO] - ModbusTCP server listening on modbus://127.0.0.1:15021
32
+ 2026-10-09 20:50:00.299 [INFO] - client connected: 127.0.0.1:59293
33
+ 2026-10-09 20:50:00.299 [INFO] - connected to modbus://127.0.0.1:15021!
34
+ 2026-10-09 20:50:00.571 [INFO] - ModbusTCP server listening on modbus://127.0.0.1:15022
35
+ 2026-10-09 20:50:00.574 [INFO] - client connected: 127.0.0.1:59294
36
+ 2026-10-09 20:50:00.575 [INFO] - connected to modbus://127.0.0.1:15022!
@@ -0,0 +1 @@
1
+ 2026-10-10 15:30:20.958 [ERROR] - section S1: pressure alarm arrived
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -0,0 +1,3 @@
1
+ 2026-10-25 03:57:56.318 [INFO] - connected to modbus://127.0.0.1:502!
2
+ 2026-10-25 04:09:03.633 [INFO] - connected to modbus://127.0.0.1:502!
3
+ 2026-10-25 06:10:21.360 [INFO] - connected to modbus://127.0.0.1:502!
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -0,0 +1 @@
1
+ 2026-11-14 15:02:50.739 [INFO] - read C:/Users/goosy/AppData/Local/Temp/tmp.JkoN2BmtuV/system.yaml
File without changes
File without changes
File without changes
File without changes