dsh-plc-decode 0.2.0 → 0.2.2
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.
- package/README.en.md +115 -27
- package/README.md +112 -135
- package/assets/codesys-tools/dvp_decode.py +53 -4
- package/assets/codesys-tools/read_project.py +1 -1
- package/assets/decode-pack.mjs +2 -2
- package/assets/dvp-ladder.mjs +174 -0
- package/assets/ebpro-decode.mjs +305 -0
- package/assets/{zzuser-hmi-decode-workflow.md → hmi-decode-workflow.md} +11 -13
- package/assets/hmismart-decode.mjs +453 -452
- package/assets/hmismart-report.mjs +9 -14
- package/assets/lad-branches.mjs +147 -0
- package/assets/ladder-render.mjs +118 -0
- package/assets/ladder-workflow.md +80 -0
- package/assets/smart-ladder-auto.mjs +182 -0
- package/assets/stl-to-ladder.mjs +299 -0
- package/hmi.js +38 -185
- package/index.js +71 -10
- package/ladder.js +381 -0
- package/package.json +7 -6
- package/scripts/smoke.mjs +2 -2
- package/assets/FStudio/346/226/207/346/234/254/345/272/223/345/257/274/345/205/245/346/240/274/345/274/217.md +0 -45
- package/assets/wincc_i18n.py +0 -504
- package/assets/zzuser-fstudio-i18n-workflow.md +0 -165
- package/assets/zzuser-nb-textlib-workflow.md +0 -93
- package/assets/zzuser-wincc-text-i18n-workflow.md +0 -96
- package/invariant.js +0 -10
package/README.en.md
CHANGED
|
@@ -1,30 +1,42 @@
|
|
|
1
1
|
# dsh-plc-decode
|
|
2
2
|
|
|
3
|
+
<img src="assets/icon-180.png" width="96" align="right" alt="dsh-plc-decode">
|
|
4
|
+
|
|
3
5
|
[中文](README.md) | **English**
|
|
4
6
|
|
|
5
|
-
Read PLC project files directly inside [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) (DSH)
|
|
7
|
+
Read PLC project files directly inside [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) (DSH): the plugin detects the format from the file header, decodes the project into readable reports and structured data, and provides project diffing, address audits, element-level read/write analysis and ladder-logic reconstruction. The same plugin row also covers HMI projects: screens, controls, tags and addresses; for Weintek EasyBuilder Pro it reads the compiled output of the project and decodes screens, text objects, alarm events and text-library entries.
|
|
6
8
|
|
|
7
9
|
**Read-only**: project files are parsed, never modified.
|
|
8
10
|
|
|
9
|
-
## Supported
|
|
11
|
+
## Supported files
|
|
10
12
|
|
|
11
13
|
| Header | Format | Decoder |
|
|
12
14
|
|---|---|---|
|
|
13
15
|
| `50 4B 03 04` (ZIP) | CoDeSys V3.5 / LeadSysStudio `.project` (incl. Leadshine) | Bundled Python script: unpack → string table → restore POU ST sources |
|
|
14
|
-
| `57 01 01 00` | Delta WPLSoft / ISPSoft `.dvp` | Bundled Python script: structure / section comments / device comments / instruction table |
|
|
15
|
-
| `53 48 33 00` (SH3) | Siemens S7-200 SMART `.smart` | Embedded Node decoder: blocks / instruction records / operands / user
|
|
16
|
+
| `57 01 01 00` | Delta WPLSoft / ISPSoft `.dvp` | Bundled Python script: file structure / section comments / device comments / instruction table |
|
|
17
|
+
| `53 48 33 00` (SH3) | Siemens S7-200 SMART `.smart` | Embedded Node decoder: blocks / instruction records / operands / user and system symbol tables |
|
|
16
18
|
| `44 45 4D 00` (DEM) | Siemens S7-200 SMART `.smartlib` | Embedded Node decoder: library variables and comment stream |
|
|
17
19
|
|
|
18
|
-
> Leadshine LeadSysStudio saves CoDeSys-format `.project` files
|
|
20
|
+
> Leadshine LeadSysStudio saves CoDeSys-format `.project` files; they decode through the same path: ST sources go to `pous/<POU>.txt`, and `/codesys-check` runs an equivalent compile check (struct members, array bounds, calls, address uniqueness, undeclared symbols).
|
|
21
|
+
|
|
22
|
+
### HMI projects
|
|
23
|
+
|
|
24
|
+
| File | Brand | Decoded |
|
|
25
|
+
|---|---|---|
|
|
26
|
+
| `.hmismart` | Siemens WinCC flexible SMART (Smart Line) | Screens / objects / texts / devices; the sibling `{{GUID}}.data` files yield tag names, control names, binding candidates and the type table |
|
|
27
|
+
| `.fsprj` or a folder containing `HMI\Frame` | Flexem FStudio | Screens / controls / control addresses (from `HMI\System\fs2.s3db` and `Bin\fshmi.bin`) |
|
|
28
|
+
| `.nbp` | Omron NB-Designer | Screens / controls / addresses (XML) |
|
|
29
|
+
| `.mcp` / `.mcgs` | MCGS / LSTP Studio | Screens / tags / alarms / strategies (Access database) |
|
|
30
|
+
| `.emtp` / `.exob` | Weintek EasyBuilder Pro | Screens / text objects / alarm events / text library (the `.emtp` body is encrypted; the plugin reads the compiled `.exob` of the same project) |
|
|
19
31
|
|
|
20
32
|
## Install
|
|
21
33
|
|
|
22
34
|
Prerequisites:
|
|
23
35
|
|
|
24
|
-
- DSH desktop app (the plugin runs inside DSH; Node version follows DSH);
|
|
36
|
+
- DSH desktop app (the plugin runs inside DSH; the Node version follows DSH);
|
|
25
37
|
- Python 3.9+ on `PATH` for `.project` / `.dvp` (standard library only, no `pip install`);
|
|
26
|
-
- Python is not needed for `.smart` / `.smartlib
|
|
27
|
-
-
|
|
38
|
+
- Python is not needed for `.smart` / `.smartlib`;
|
|
39
|
+
- requires DSH >= 0.2.1-alpha.3; verified on 0.2.1-alpha.3 and 0.2.2-rc.1, later versions untested.
|
|
28
40
|
|
|
29
41
|
```sh
|
|
30
42
|
dsh plugin --profile web add github:taoziliyouchong/dsh-plc-decode
|
|
@@ -38,48 +50,124 @@ Restart DSH afterwards. The plugin has no npm runtime dependencies.
|
|
|
38
50
|
|
|
39
51
|
| Tool | Purpose |
|
|
40
52
|
|---|---|
|
|
41
|
-
| `plc-decode` | Unified entry: detect the four formats and dispatch; args `file`, optional `outDir` |
|
|
53
|
+
| `plc-decode` | Unified entry: detect the four PLC formats and dispatch; args `file`, optional `outDir` |
|
|
42
54
|
| `smart-pou-structure` | Internal structure of one POU: interface parameters (L-area address + type), box-level instruction chain, call sites and arguments |
|
|
43
|
-
| `smart-lad` | Ladder reconstruction: per block
|
|
55
|
+
| `smart-lad` | Ladder reconstruction: per block and network, the LAD instruction sequence (LD/A/O/AN/ON, EU/ED, LPS/LRD/LPP, coils, comparisons, instruction-box placeholders) |
|
|
44
56
|
| `smart-ladder-elements` | Element-level read/write judgement for one address (or a batch) |
|
|
45
57
|
| `smart-net-trace` | Network trace: elements, write coils, boxes and constants in offset order |
|
|
46
58
|
| `smart-box-pins` | Box pin table: pin name = actual argument for library call boxes (MBUS_CTRL, MBUS_MSG, TON, CTU, MOV_*, …) |
|
|
47
|
-
| `smart-pin-dump` | Byte-level location: all occurrences of an address, or operand records
|
|
48
|
-
| `smart-var-usage` | Variable audit: all references,
|
|
49
|
-
| `smart-free-space` | Address usage and free ranges: pick new addresses
|
|
59
|
+
| `smart-pin-dump` | Byte-level location: all occurrences of an address, or the operand records inside an offset range |
|
|
60
|
+
| `smart-var-usage` | Variable audit: all references, other address forms over the same bytes, write-point judgement |
|
|
61
|
+
| `smart-free-space` | Address usage and free ranges: pick new addresses before extending a program |
|
|
50
62
|
| `smart-conflict` | Address conflicts: overlaps (real / suspected / registered only) and fragmented free space |
|
|
51
63
|
| `smart-diff-project` | SMART project diff: block list, call chain, I/O references, symbol table |
|
|
52
64
|
| `codesys-diff-project` | CoDeSys project diff: POU list, real logic changes, whitespace, string table, object table |
|
|
65
|
+
| `hmi-decode` | HMI unified entry: identifies `.hmismart` / `.fsprj` / `.nbp` / `.mcp` / `.emtp` / `.exob` and processes it |
|
|
66
|
+
| `hmi-diff-project` | HMI project diff for two `.hmismart` files: start screen, screen records, screen names, companion files |
|
|
67
|
+
| `ebpro-decode` | Weintek EasyBuilder Pro: decode screens / text objects / alarm events / text library from the compiled `.exob` |
|
|
68
|
+
| `ladder-auto` | Auto ladder: read a `.smart` project and render box-style text ladders per block/network (`block`, `net`) |
|
|
69
|
+
| `ladder-dvp` | Delta `.dvp` → text ladder, optionally limited to a line range |
|
|
70
|
+
| `ladder-from-stl` | Statement list (STL) → text ladder plus a mechanical explanation per network |
|
|
71
|
+
| `ladder-render` | Render a network description (spec JSON) into the fixed text-ladder layout |
|
|
53
72
|
|
|
54
73
|
### Slash commands
|
|
55
74
|
|
|
56
|
-
|
|
75
|
+
| Command | Purpose |
|
|
76
|
+
|---|---|
|
|
77
|
+
| `/plc-decode <file> [outDir]` | Unified decode entry |
|
|
78
|
+
| `/plc-archive` | Show the effective archive root, the default target and how to change it |
|
|
79
|
+
| `/codesys-read <project>` | Decode a `.project` (ST sources + report) or a `.dvp` (report) |
|
|
80
|
+
| `/dvp-read <project>` | Delta DVP structure and instruction-table report |
|
|
81
|
+
| `/smart-read <.smart/.smartlib> [outDir]` | Decode a SMART project or library |
|
|
82
|
+
| `/codesys-check <project>` | Decode a `.project`, then run an equivalent static compile check |
|
|
83
|
+
| `/codesys-diff <old> <new>` | CoDeSys project diff |
|
|
84
|
+
| `/smart-diff <old> <new>` | SMART project diff |
|
|
85
|
+
| `/smart-free-space <.smart>` | Address usage and free ranges |
|
|
86
|
+
| `/smart-conflict <.smart>` | Address conflict audit |
|
|
87
|
+
| `/smart-ladder <.smart> [address]` | Element-level read/write judgement |
|
|
88
|
+
| `/smart-lad <.smart> [block] [network]` | Ladder reconstruction (LAD instruction sequence) |
|
|
89
|
+
| `/hmi-decode <.hmismart / .fsprj / .nbp / .mcp / .emtp / .exob> [outDir]` | HMI project decode |
|
|
90
|
+
| `/hmi-diff <old .hmismart> <new .hmismart>` | HMI project diff |
|
|
91
|
+
| `/ladder on\|off\|status` | Ladder switch (off by default; takes effect immediately) |
|
|
92
|
+
| `/ladder-auto <.smart> [block] [net] [out.txt]` | Render a `.smart` project |
|
|
93
|
+
| `/ladder-dvp <.dvp> [from] [to] [out.txt]` | Render a `.dvp` project |
|
|
94
|
+
| `/ladder-stl <stl.txt> [out.txt]` | Statement list → ladder + explanation |
|
|
95
|
+
| `/ladder-spec <spec.json> [out.txt]` | Render a spec JSON |
|
|
96
|
+
| `/plc-calibrate <format> <bytes or cmd:XX> <name> [note]` | Record an unresolved byte/opcode in the calibration table; later decodes use the name |
|
|
57
97
|
|
|
58
98
|
## Output
|
|
59
99
|
|
|
60
|
-
|
|
100
|
+
By default the plugin writes to `解码归档/<project folder name>/` in the **workspace** (the folder name is used rather than the file name, so same-named projects in different folders do not overwrite each other; when one folder holds several project files, `<folder>_<file>` is used). Pass `outDir` to override.
|
|
101
|
+
|
|
102
|
+
| Format | Main files |
|
|
103
|
+
|---|---|
|
|
104
|
+
| `.project` | `00-索引.md` (read this first), `pous/<POU>.txt` (ST sources), `工程内容报告.md`, `全部字符串.txt`, `对象表.md`, `项目树.md` |
|
|
105
|
+
| `.dvp` | `00-索引.md`, `解码报告.md` (structure / section comments / device comments / instruction table) |
|
|
106
|
+
| `.smart` / `.smartlib` | `00-目录.md` (read this first), `解码报告.md`, `程序.lad`, `元素记录.tsv`, `符号地址.tsv`, `分析.md`, `记录.json`, `字符串全录.txt` |
|
|
107
|
+
| `.hmismart` | `10-画面.tsv`, `11-元件.tsv`, `12-文本.tsv`, `13-设备.tsv`, `20-变量.data.tsv`, `21-控件.data.tsv`, `23-控件绑定.data.tsv`, `24-类型表.tsv` |
|
|
108
|
+
| `.fsprj` | `画面.tsv`, `控件.tsv`, `控件地址.tsv`, `变量.tsv` |
|
|
109
|
+
| `.nbp` / `.mcp` | `解码报告.md` plus screen/control (or tag/alarm/strategy) JSON |
|
|
110
|
+
| `.emtp` / `.exob` | `HMI解码/HMI解码报告.md` + `00-格式说明.md`, `10-画面.tsv`, `11-文字对象.tsv`, `12-报警事件.tsv`, `13-文字库.tsv`, `08-统计.json` |
|
|
111
|
+
|
|
112
|
+
### Ladder rendering (off by default)
|
|
61
113
|
|
|
62
|
-
|
|
63
|
-
- `.dvp` → `00-索引.md`, `解码报告.md`
|
|
64
|
-
- `.smart` / `.smartlib` → `00-目录.md`, `解码报告.md`, `程序.lad`, `元素记录.tsv`, `符号地址.tsv`, `分析.md`, `记录.json`, `字符串全录.txt`
|
|
114
|
+
Ladder tools are disabled by default so a plain decode does not add another set of tools:
|
|
65
115
|
|
|
66
|
-
|
|
116
|
+
- Turn on: `/ladder on` (immediate, no restart); off: `/ladder off`; status: `/ladder status`
|
|
117
|
+
- Or set `config: { ladder: true }` on this plugin's row in the profile `cordis.patch.yml` as the initial state
|
|
118
|
+
- While disabled, the ladder tools answer with a one-line hint; decoding is unaffected
|
|
119
|
+
- The first three decodes append a hint that ladder diagrams are available (1/3, 2/3, 3/3), then it stops; switch state and the counter live in `$DSH_HOME/ladder-state.json`
|
|
67
120
|
|
|
68
|
-
|
|
121
|
+
### Changing the archive root (no code change)
|
|
69
122
|
|
|
70
|
-
|
|
71
|
-
|
|
123
|
+
Add `archiveDir` to this plugin's row in the profile `cordis.patch.yml` (`$DSH_HOME/profiles/<profile>/cordis.patch.yml`):
|
|
124
|
+
|
|
125
|
+
`archiveDir` is the archive **root**: a relative path resolves against the current session workspace, an absolute path is used as is; the default is `解码归档`. Restart DSH after changing it; `/plc-archive` shows the effective value, and `outDir` overrides it for a single run.
|
|
126
|
+
|
|
127
|
+
The smart `记录.json` is the input of the analysis tools (address usage, variable usage, …) and also the marker that identifies a decoded directory. The report header carries a **source fingerprint** (file size + mtime); re-check it after the project changes.
|
|
128
|
+
|
|
129
|
+
## Known limits
|
|
130
|
+
|
|
131
|
+
- HMI projects: `.hmismart` carries only the template skeleton — real screens and controls live in the sibling `{{GUID}}.data` (ES2RT stream). Tag names and control names can be decoded; control-to-tag references are recovered only for same-segment co-occurrence and UUID hits, the rest is reported as undecoded. Without tags, a FStudio project keeps control addresses only in the action table of `Bin\fshmi.bin`. MCGS decoding needs a sample to verify against.
|
|
132
|
+
- Weintek EasyBuilder Pro: the `.emtp` body is compressed and encrypted, so only the compiled `.exob` of the same project can be read; the tables reflect the project **at compile time** (recompile first if the project changed). The compiled output carries only the source language, no translations. Screen membership is inferred from object-stream segments; x/y/w/h in the tables are text-box metrics, not screen coordinates.
|
|
133
|
+
- Pin-level arguments of library call boxes (e.g. Slave / RW / Addr / Count / DataPtr of MBUS_MSG) cannot be decoded; the tools say so instead of guessing.
|
|
72
134
|
- Encrypted or specially compressed projects may fail to decode; the decoder reports an error rather than a half-true result.
|
|
73
135
|
- Ladder series/parallel topology is reconstructed from instruction records (validated network-by-network against official STL exports); library call regions without standard box headers are not covered.
|
|
74
|
-
- Inferred instruction names are marked with `?`; undecoded names keep
|
|
136
|
+
- Inferred instruction names are marked with `?`; undecoded names keep the raw form `??xx`.
|
|
75
137
|
|
|
76
138
|
## Development
|
|
77
139
|
|
|
78
140
|
```sh
|
|
79
|
-
npm run check
|
|
80
|
-
npm run smoke
|
|
81
|
-
npm run smoke -- <project>
|
|
82
|
-
npm pack --dry-run
|
|
141
|
+
npm run check # syntax check
|
|
142
|
+
npm run smoke # load the plugin and verify registrations (19 tools / 20 commands)
|
|
143
|
+
npm run smoke -- <project> # additionally decode one real project end-to-end
|
|
144
|
+
npm pack --dry-run # inspect package contents (node_modules and publish/ must not be inside)
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
## Structure
|
|
148
|
+
|
|
149
|
+
```
|
|
150
|
+
index.js plugin entry: tool and command registration, format dispatch, SMART decoder
|
|
151
|
+
hmi.js HMI decoding module (tools/commands/skill registration, called by index.js)
|
|
152
|
+
ladder.js ladder rendering module (off by default, /ladder on; called by index.js)
|
|
153
|
+
assets/decode-pack.mjs decoded-output writer (indexes, tables, records)
|
|
154
|
+
assets/smart-lad.mjs ladder reconstruction script (used by smart-lad)
|
|
155
|
+
assets/smart-net-trace.mjs network trace script (used by smart-net-trace)
|
|
156
|
+
assets/codesys-tools/ CoDeSys / DVP decoding Python scripts (standard library only)
|
|
157
|
+
assets/hmismart-decode.mjs Siemens .hmismart decoder (structure tables + .data names/bindings)
|
|
158
|
+
assets/hmismart-report.mjs .hmismart human-readable report (screens/tags/connections)
|
|
159
|
+
assets/hmismart-diff.mjs .hmismart project diff
|
|
160
|
+
assets/fstudio-tables.py FStudio screen / control / control-address tables
|
|
161
|
+
assets/fstudio_i18n.py FStudio element-text scan (per language slot)
|
|
162
|
+
assets/hmi-decode-workflow.md HMI reading workflow (skill text)
|
|
163
|
+
assets/nb-decode.mjs Omron NB-Designer decoder
|
|
164
|
+
assets/mcgs-decode.mjs MCGS / LSTP decoder
|
|
165
|
+
assets/ebpro-decode.mjs Weintek EasyBuilder Pro decoder (from .exob)
|
|
166
|
+
assets/ladder-render.mjs text-ladder renderer (used by ladder-render)
|
|
167
|
+
assets/stl-to-ladder.mjs STL → ladder (used by ladder-from-stl)
|
|
168
|
+
assets/smart-ladder-auto.mjs .smart auto renderer (used by ladder-auto)
|
|
169
|
+
assets/dvp-ladder.mjs .dvp auto renderer (used by ladder-dvp)
|
|
170
|
+
scripts/smoke.mjs smoke test
|
|
83
171
|
```
|
|
84
172
|
|
|
85
173
|
## Feedback
|
package/README.md
CHANGED
|
@@ -2,166 +2,143 @@
|
|
|
2
2
|
|
|
3
3
|
<img src="assets/icon-180.png" width="96" align="right" alt="dsh-plc-decode">
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
**涓枃** | [English](README.en.md)
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
## 支持的工程文件
|
|
12
|
-
|
|
13
|
-
| 文件头 | 格式 | 解码方式 |
|
|
7
|
+
鍦?[DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness)锛圖SH锛夐噷鐩存帴璇?PLC 宸ョ▼鏂囦欢锛氭寜鏂囦欢澶磋嚜鍔ㄨ瘑鍒牸寮忥紝鎶婂伐绋嬭В鎴愬彲璇绘姤鍛婁笌缁撴瀯鍖栨暟鎹紝鍐嶅熀浜庤В鐮佺粨鏋滃仛鏂版棫瀵规瘮銆佸湴鍧€浣撴銆佸厓绱犵骇璇?鍐欏垽瀹氫笌杩炵嚎杩樺師銆傚悓涓€鎻掍欢琛岄噷涔熸壙鎺ヨЕ鎽稿睆锛圚MI锛夊伐绋嬶細鐢婚潰銆佹帶浠躲€佸彉閲忎笌鍦板潃锛涘▉绾堕€?EasyBuilder Pro 宸ョ▼璇诲悓宸ョ▼鐨勭紪璇戜骇鐗╋紝瑙e嚭鐢婚潰銆佹枃瀛楀璞°€佹姤璀︿簨浠朵笌鏂囧瓧搴撴潯鐩€?
|
|
8
|
+
**鍙**锛氳В鏋愬伐绋嬫枃浠讹紝涓嶆敼鍔ㄥ師鏂囦欢銆?
|
|
9
|
+
## 鏀寔鐨勫伐绋嬫枃浠?
|
|
10
|
+
| 鏂囦欢澶?| 鏍煎紡 | 瑙g爜鏂瑰紡 |
|
|
14
11
|
|---|---|---|
|
|
15
|
-
| `50 4B 03 04
|
|
16
|
-
| `57 01 01 00` |
|
|
17
|
-
| `53 48 33 00
|
|
18
|
-
| `44 45 4D 00
|
|
19
|
-
|
|
20
|
-
>
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
| 文件 | 品牌 | 解出 |
|
|
12
|
+
| `50 4B 03 04`锛圸IP锛?| CoDeSys V3.5 / LeadSysStudio `.project`锛堝惈闆疯禌锛?| 鑷甫 Python 鑴氭湰锛氳В鍖?鈫?瀛楃涓茶〃 鈫?閫愬璞℃仮澶?POU ST 婧愮爜 |
|
|
13
|
+
| `57 01 01 00` | 鍙拌揪 WPLSoft / ISPSoft `.dvp` | 鑷甫 Python 鑴氭湰锛氭枃浠剁粨鏋?/ 娈佃惤娉ㄩ噴 / 璁惧娉ㄩ噴 / 鎸囦护琛ㄥ弽姹囩紪 |
|
|
14
|
+
| `53 48 33 00`锛圫H3锛?| 瑗块棬瀛?S7-200 SMART `.smart` 宸ョ▼ | 鍐呭祵 Node 瑙g爜鍣細鍧?/ 鎸囦护璁板綍 / 鎿嶄綔鏁?/ 鐢ㄦ埛涓庣郴缁熺鍙疯〃 |
|
|
15
|
+
| `44 45 4D 00`锛圖EM锛?| 瑗块棬瀛?S7-200 SMART `.smartlib` 搴?| 鍐呭祵 Node 瑙g爜鍣細搴撳彉閲忎笌娉ㄩ噴娴?|
|
|
16
|
+
|
|
17
|
+
> 闆疯禌锛圠eadshine锛夌敤 LeadSysStudio 淇濆瓨鐨?`.project` 涓?CoDeSys 鍚屾牸寮忥紝璧板悓涓€鏉¤В鐮侀摼锛歋T 婧愮爜瀵煎嚭鍒?`pous/<POU>.txt`锛屽彲鐢?`/codesys-check` 鍋氱瓑浠风紪璇戞牎楠岋紙缁撴瀯浣撴垚鍛樸€佹暟缁勪笅鏍囥€佽皟鐢ㄥ瓨鍦ㄦ€с€佸湴鍧€鍞竴銆佹湭澹版槑绗﹀彿锛夈€?
|
|
18
|
+
### 瑙︽懜灞忥紙HMI锛夊伐绋?
|
|
19
|
+
| 鏂囦欢 | 鍝佺墝 | 瑙e嚭 |
|
|
25
20
|
|---|---|---|
|
|
26
|
-
| `.hmismart` |
|
|
27
|
-
| `.fsprj`
|
|
28
|
-
| `.nbp` |
|
|
29
|
-
| `.mcp` / `.mcgs` |
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
- DSH
|
|
36
|
-
-
|
|
37
|
-
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
从 GitHub 安装:
|
|
41
|
-
|
|
21
|
+
| `.hmismart` | 瑗块棬瀛?WinCC flexible SMART锛圫mart Line 灞忥級 | 鐢婚潰 / 鍏冧欢 / 鏂囨湰 / 璁惧琛紱鏃佺郴 `{{GUID}}.data` 閲岃В鍙橀噺鍚嶃€佹帶浠跺悕銆佺粦瀹氬€欓€夈€佺被鍨嬭〃 |
|
|
22
|
+
| `.fsprj` 鎴栧惈 `HMI\Frame` 鐨勭洰褰?| 绻佹槗 FStudio / Flexem | 鐢婚潰 / 鎺т欢 / 鎺т欢鍦板潃锛堣 `HMI\System\fs2.s3db` 涓?`Bin\fshmi.bin`锛?|
|
|
23
|
+
| `.nbp` | 娆у榫?NB-Designer | 鐢婚潰 / 鎺т欢 / 鍦板潃锛圶ML 鐩磋锛?|
|
|
24
|
+
| `.mcp` / `.mcgs` | 鏄嗕粦閫氭€?MCGS / LSTP Studio | 鐢婚潰 / 鍙橀噺 / 鎶ヨ / 绛栫暐锛圓ccess 搴擄級 |
|
|
25
|
+
| `.emtp` / `.exob` | 濞佺憾閫?EasyBuilder Pro | 鐢婚潰 / 鏂囧瓧瀵硅薄 / 鎶ヨ浜嬩欢 / 鏂囧瓧搴擄紙`.emtp` 鏈綋鍔犲瘑璇讳笉鍔紝璇诲悓宸ョ▼缂栬瘧浜х墿 `.exob`锛?|
|
|
26
|
+
|
|
27
|
+
## 瀹夎
|
|
28
|
+
|
|
29
|
+
鍓嶆彁锛?
|
|
30
|
+
- DSH 妗岄潰绔紙鎻掍欢杩愯鍦?DSH 鍐咃紝Node 鐗堟湰璺熼殢 DSH锛夛紱
|
|
31
|
+
- 瑙g爜 `.project` / `.dvp` 闇€瑕?Python 3.9+ 鍦?`PATH` 閲岋紙鍙敤鏍囧噯搴擄紝鏃犻渶 pip 瀹夎锛夛紱
|
|
32
|
+
- 瑙g爜 `.smart` / `.smartlib` 涓嶉渶瑕?Python銆?- 瑕佹眰 DSH >= 0.2.1-alpha.3锛涘疄娴?0.2.1-alpha.3銆?.2.2-rc.1锛屾洿楂樼増鏈湭楠岃瘉銆?
|
|
33
|
+
浠?GitHub 瀹夎锛?
|
|
42
34
|
```sh
|
|
43
35
|
dsh plugin --profile web add github:taoziliyouchong/dsh-plc-decode
|
|
44
36
|
```
|
|
45
37
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
## 使用
|
|
38
|
+
瑁呭畬閲嶅惎 DSH銆傛湰鎻掍欢娌℃湁 npm 杩愯鏃朵緷璧栥€?
|
|
39
|
+
## 浣跨敤
|
|
49
40
|
|
|
50
|
-
###
|
|
41
|
+
### 宸ュ叿锛堟ā鍨嬭嚜鍔ㄨ皟鐢級
|
|
51
42
|
|
|
52
|
-
|
|
|
43
|
+
| 宸ュ叿 | 鐢ㄩ€?|
|
|
53
44
|
|---|---|
|
|
54
|
-
| `plc-decode` |
|
|
55
|
-
| `smart-pou-structure` |
|
|
56
|
-
| `smart-lad` |
|
|
57
|
-
| `smart-ladder-elements` |
|
|
58
|
-
| `smart-net-trace` |
|
|
59
|
-
| `smart-box-pins` |
|
|
60
|
-
| `smart-pin-dump` |
|
|
61
|
-
| `smart-var-usage` |
|
|
62
|
-
| `smart-free-space` |
|
|
63
|
-
| `smart-conflict` |
|
|
64
|
-
| `smart-diff-project` | SMART
|
|
65
|
-
| `codesys-diff-project` | CoDeSys
|
|
66
|
-
| `hmi-decode` |
|
|
67
|
-
| `hmi-diff-project` |
|
|
68
|
-
| `
|
|
69
|
-
| `
|
|
70
|
-
| `
|
|
71
|
-
| `
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
|
45
|
+
| `plc-decode` | 缁熶竴鍏ュ彛锛氭寜鏂囦欢澶磋瘑鍒洓鏍煎紡骞跺垎鍙戣В鐮侊紝鍙傛暟 `file` + 鍙€?`outDir` |
|
|
46
|
+
| `smart-pou-structure` | 鏌愬瓙绋嬪簭鐨勫唴閮ㄧ粨鏋勶細鎺ュ彛鍙傛暟锛圠 鍖哄湴鍧€ + 绫诲瀷锛夈€佺洅绾ф寚浠ら摼銆佽皟鐢ㄧ偣瀹炲弬 |
|
|
47
|
+
| `smart-lad` | 杩炵嚎杩樺師锛氭寜鍧椼€佹寜缃戠粶鎵撳嵃 LAD 鎸囦护搴忓垪锛圠D/A/O/AN/ON銆丒U/ED銆丩PS/LRD/LPP銆佺嚎鍦堛€佹瘮杈冦€佹寚浠ょ洅鍗犱綅锛?|
|
|
48
|
+
| `smart-ladder-elements` | 鍏冪礌绾ц/鍐欏垽瀹氾細鏌愬湴鍧€锛堝彲涓€鎵癸級鐨勬瘡涓惤鐐规槸瑙︾偣锛堣锛夎繕鏄啓 |
|
|
49
|
+
| `smart-net-trace` | 缃戠粶绾ц建杩癸細缁欏亸绉诲尯闂达紝鎸夐『搴忓垪鍑鸿Е鐐?/ 鍐欏厓浠?/ 鎸囦护鐩?/ 甯告暟 |
|
|
50
|
+
| `smart-box-pins` | 鐩掔骇寮曡剼琛細搴撹皟鐢ㄧ洅锛圡BUS_CTRL銆丮BUS_MSG銆乀ON銆丆TU銆丮OV_* 绛夛級鐨勩€屽紩鑴氬悕 = 瀹炲弬銆?|
|
|
51
|
+
| `smart-pin-dump` | 瀛楄妭绾у畾浣嶏細鏌愬湴鍧€鐨勫叏閮ㄥ嚭鐜颁綅缃紝鎴栨煇鍋忕Щ鍖洪棿鍐呯殑鎿嶄綔鏁拌褰?|
|
|
52
|
+
| `smart-var-usage` | 鍙橀噺浣跨敤浣撴锛氭煇鍦板潃鐨勫叏閮ㄥ紩鐢ㄧ偣銆佸叡鐢ㄥ瓧鑺傜殑鍏跺畠鍦板潃褰㈠紡銆佸啓鍏ョ偣鍒ゅ畾 |
|
|
53
|
+
| `smart-free-space` | 鍦板潃鍗犵敤涓庣┖闂叉锛氬姞鍔熻兘鍓嶉€夋柊鍦板潃锛堟湁绗﹀彿鍚嶇殑銆侀鐣欏潙閮戒笉鍔級 |
|
|
54
|
+
| `smart-conflict` | 鍦板潃鍐茬獊浣撴锛氶噸鍙犲啿绐侊紙鐪熷啿绐?/ 鐤戜技 / 浠呯櫥璁帮級+ 杩炵画绌洪棿琚垏纰?|
|
|
55
|
+
| `smart-diff-project` | SMART 鏂版棫宸ョ▼瀵规瘮锛氬潡娓呭崟銆佷富绋嬪簭璋冪敤閾俱€両-O 寮曠敤銆佺鍙疯〃宸紓 |
|
|
56
|
+
| `codesys-diff-project` | CoDeSys 鏂版棫宸ョ▼瀵规瘮锛歅OU 娓呭崟銆佺湡瀹為€昏緫鍙樺寲鍖烘銆佺┖鐧藉樊寮傘€佸瓧绗︿覆琛ㄣ€佸璞¤〃 |
|
|
57
|
+
| `hmi-decode` | 瑙︽懜灞忕粺涓€鍏ュ彛锛氭寜鏂囦欢璇嗗埆 `.hmismart` / `.fsprj` / `.nbp` / `.mcp` / `.emtp` / `.exob` 骞跺鐞?|
|
|
58
|
+
| `hmi-diff-project` | 鏂版棫 `.hmismart` 瀵规瘮锛氳捣濮嬬敾闈€佺敾闈㈣〃銆佺敾闈㈠悕銆侀厤濂楁枃浠?|
|
|
59
|
+
| `ebpro-decode` | 濞佺憾閫?EBpro锛氳缂栬瘧浜х墿 `.exob` 瑙g爜鐢婚潰 / 鏂囧瓧瀵硅薄 / 鎶ヨ浜嬩欢 / 鏂囧瓧搴擄紙鍑?HMI瑙g爜鎶ュ憡.md 涓?4 寮?tsv锛?|
|
|
60
|
+
| `ladder-auto` | 鑷姩鐢绘褰㈠浘锛氱洿鎺ヨ `.smart`锛屾寜鍧?缃戠粶鐢熸垚鐩掑紡鏂囧瓧姊舰鍥撅紙鍙寚瀹?`block` / `net`锛?|
|
|
61
|
+
| `ladder-dvp` | 鍙拌揪 `.dvp` 鐩存帴鍑虹洅寮忔枃瀛楁褰㈠浘锛堝彲鎸夎鍙疯寖鍥达級 |
|
|
62
|
+
| `ladder-from-stl` | 璇彞琛紙STL锛夆啋 鏂囧瓧姊舰鍥?+ 鏈烘璁茶В |
|
|
63
|
+
| `ladder-render` | 鎶婄綉缁滄弿杩帮紙spec锛夋覆鏌撴垚鍥哄畾鐗堝紡鐨勬枃瀛楁褰㈠浘 |
|
|
64
|
+
|
|
65
|
+
### 鏂滄潬鍛戒护锛堜汉鐩存帴鎵ц锛?
|
|
66
|
+
| 鍛戒护 | 鐢ㄩ€?|
|
|
76
67
|
|---|---|
|
|
77
|
-
| `/plc-decode
|
|
78
|
-
| `/plc-archive` |
|
|
79
|
-
| `/codesys-read
|
|
80
|
-
| `/dvp-read
|
|
81
|
-
| `/smart-read <.smart/.smartlib> [
|
|
82
|
-
| `/codesys-check
|
|
83
|
-
| `/codesys-diff
|
|
84
|
-
| `/smart-diff
|
|
85
|
-
| `/smart-free-space <.smart>` |
|
|
86
|
-
| `/smart-conflict <.smart>` |
|
|
87
|
-
| `/smart-ladder <.smart> [
|
|
88
|
-
| `/smart-lad <.smart> [
|
|
89
|
-
| `/hmi-decode <.hmismart / .fsprj / .nbp / .mcp> [
|
|
90
|
-
| `/hmi-diff
|
|
91
|
-
| `/
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
68
|
+
| `/plc-decode <鏂囦欢> [杈撳嚭鐩綍]` | 缁熶竴瑙g爜鍏ュ彛 |
|
|
69
|
+
| `/plc-archive` | 鏌ョ湅褰撳墠鐢熸晥鐨勮В鐮佸綊妗f牴鐩綍銆侀粯璁よ惤鐐逛笌鏀归厤缃殑鏂规硶 |
|
|
70
|
+
| `/codesys-read <宸ョ▼>` | 瑙g爜 `.project`锛圫T 婧愮爜 + 鎶ュ憡锛夋垨 `.dvp`锛堣В鐮佹姤鍛婏級 |
|
|
71
|
+
| `/dvp-read <宸ョ▼>` | 鍙拌揪 DVP 缁撴瀯涓庢寚浠よ〃鎶ュ憡 |
|
|
72
|
+
| `/smart-read <.smart/.smartlib> [杈撳嚭鐩綍]` | SMART 宸ョ▼ / 搴撹В鐮?|
|
|
73
|
+
| `/codesys-check <宸ョ▼>` | 瑙g爜 `.project` 鍚庡仛绛変环缂栬瘧闈欐€佹牎楠岋紙缁撴瀯浣?/ 璋冪敤 / 鍦板潃鍞竴 / 鏈0鏄庣鍙凤級 |
|
|
74
|
+
| `/codesys-diff <鏃? <鏂?` | CoDeSys 鏂版棫瀵规瘮 |
|
|
75
|
+
| `/smart-diff <鏃? <鏂?` | SMART 鏂版棫瀵规瘮 |
|
|
76
|
+
| `/smart-free-space <.smart>` | 鍦板潃鍗犵敤涓庣┖闂叉 |
|
|
77
|
+
| `/smart-conflict <.smart>` | 鍦板潃鍐茬獊浣撴 |
|
|
78
|
+
| `/smart-ladder <.smart> [鍦板潃]` | 鍏冪礌绾ц/鍐欏垽瀹?|
|
|
79
|
+
| `/smart-lad <.smart> [鍧楀悕] [缃戠粶鍙穄` | 杩炵嚎杩樺師锛圠AD 鎸囦护搴忓垪锛?|
|
|
80
|
+
| `/hmi-decode <.hmismart / .fsprj / .nbp / .mcp / .emtp / .exob> [杈撳嚭鐩綍]` | 瑙︽懜灞忓伐绋嬭В鐮?|
|
|
81
|
+
| `/hmi-diff <鏃?.hmismart> <鏂?.hmismart>` | 瑙︽懜灞忔柊鏃у姣?|
|
|
82
|
+
| `/ladder on\|off\|status` | 姊舰鍥惧姛鑳藉紑鍏筹紙榛樿鍏抽棴锛屽紑鍚悗绔嬪嵆鐢熸晥锛?|
|
|
83
|
+
| `/ladder-auto <.smart> [鍧楀悕] [缃戠粶鍙穄 [杈撳嚭.txt]` | `.smart` 鑷姩鍑烘褰㈠浘 |
|
|
84
|
+
| `/ladder-dvp <.dvp> [璧疯] [姝㈣] [杈撳嚭.txt]` | `.dvp` 鑷姩鍑烘褰㈠浘 |
|
|
85
|
+
| `/ladder-stl <璇彞琛?txt> [杈撳嚭.txt]` | 璇彞琛ㄦ垚鍥?+ 璁茶В |
|
|
86
|
+
| `/ladder-spec <spec.json> [杈撳嚭.txt]` | 鎸?spec 娓叉煋鏂囧瓧姊舰鍥?|
|
|
87
|
+
| `/plc-calibrate <鏍煎紡> <瀛楄妭鎴?cmd:XX> <鍚嶅瓧> [澶囨敞]` | 鎶婅В涓嶅嚭鐨勫瓧鑺?鍔熻兘鐮佽杩涙牎鍑嗚〃锛涗互鍚庡悓鏍峰瓧鑺傜洿鎺ュ嚭鍚嶅瓧 |
|
|
88
|
+
|
|
89
|
+
## 杈撳嚭浣嶇疆
|
|
90
|
+
|
|
91
|
+
榛樿鍐欏埌**宸ヤ綔鍖?*鐨?`瑙g爜褰掓。/<宸ョ▼鎵€鍦ㄦ枃浠跺す鍚?/`锛堢敤鏂囦欢澶瑰悕鑰屼笉鏄伐绋嬫枃浠跺悕锛岄伩鍏嶄笉鍚屾枃浠跺す閲岀殑鍚屽悕宸ョ▼浜掔浉瑕嗙洊锛涘悓涓€鏂囦欢澶归噷鏈夊涓伐绋嬫枃浠舵椂鐢?`鏂囦欢澶瑰悕_宸ョ▼鍚峘锛夈€備篃鍙互鍦ㄥ伐鍏峰弬鏁伴噷鐢?`outDir` 鎸囧畾銆?
|
|
92
|
+
| 鏍煎紡 | 涓昏浜х墿 |
|
|
98
93
|
|---|---|
|
|
99
|
-
| `.project` | `00
|
|
100
|
-
| `.dvp` | `00
|
|
101
|
-
| `.smart` / `.smartlib` | `00
|
|
102
|
-
| `.hmismart` | `10
|
|
103
|
-
| `.fsprj` |
|
|
104
|
-
| `.nbp` / `.mcp` |
|
|
105
|
-
|
|
106
|
-
### 改归档地址(不用改代码)
|
|
107
|
-
|
|
108
|
-
在 DSH profile 的 `cordis.patch.yml`(`$DSH_HOME/profiles/<profile>/cordis.patch.yml`)末尾加这几行:
|
|
109
|
-
|
|
110
|
-
```yaml
|
|
111
|
-
- id: dsh-plc-decode
|
|
112
|
-
name: dsh-plc-decode
|
|
113
|
-
config:
|
|
114
|
-
archiveDir: D:/plc/解码归档
|
|
115
|
-
```
|
|
94
|
+
| `.project` | `00-绱㈠紩.md`锛堝厛璇昏繖浠斤級銆乣pous/<POU>.txt`锛圫T 婧愮爜锛夈€乣宸ョ▼鍐呭鎶ュ憡.md`銆乣鍏ㄩ儴瀛楃涓?txt`銆乣瀵硅薄琛?md`銆乣椤圭洰鏍?md` |
|
|
95
|
+
| `.dvp` | `00-绱㈠紩.md`銆乣瑙g爜鎶ュ憡.md`锛堢粨鏋?/ 娈佃惤娉ㄩ噴 / 璁惧娉ㄩ噴 / 鎸囦护琛級銆佸彲閫?`绋嬪簭瑙h.md` |
|
|
96
|
+
| `.smart` / `.smartlib` | `00-鐩綍.md`锛堝厛璇昏繖浠斤級銆乣瑙g爜鎶ュ憡.md`銆乣绋嬪簭.lad`銆乣鍏冪礌璁板綍.tsv`銆乣绗﹀彿鍦板潃.tsv`銆乣鍒嗘瀽.md`銆乣璁板綍.json`銆乣瀛楃涓插叏褰?txt` |
|
|
97
|
+
| `.hmismart` | `10-鐢婚潰.tsv`銆乣11-鍏冧欢.tsv`銆乣12-鏂囨湰.tsv`銆乣13-璁惧.tsv`銆乣20-鍙橀噺.data.tsv`銆乣21-鎺т欢.data.tsv`銆乣23-鎺т欢缁戝畾.data.tsv`銆乣24-绫诲瀷琛?tsv` |
|
|
98
|
+
| `.fsprj` | `鐢婚潰.tsv`銆乣鎺т欢.tsv`銆乣鎺т欢鍦板潃.tsv`銆乣鍙橀噺.tsv` |
|
|
99
|
+
| `.nbp` / `.mcp` | `瑙g爜鎶ュ憡.md` + 鐢婚潰/鎺т欢锛堟垨鍙橀噺/鎶ヨ/绛栫暐锛塉SON |
|
|
100
|
+
| `.emtp` / `.exob` | `HMI瑙g爜/HMI瑙g爜鎶ュ憡.md` + `00-鏍煎紡璇存槑.md` / `10-鐢婚潰.tsv` / `11-鏂囧瓧瀵硅薄.tsv` / `12-鎶ヨ浜嬩欢.tsv` / `13-鏂囧瓧搴?tsv` / `08-缁熻.json` |
|
|
116
101
|
|
|
117
|
-
|
|
102
|
+
### 姊舰鍥撅紙榛樿鍏抽棴锛?
|
|
103
|
+
姊舰鍥惧伐鍏烽粯璁や笉寮€鍚紝閬垮厤姣忔瑙g爜閮藉涓€鎵瑰伐鍏蜂笌鎻愮ず锛?
|
|
104
|
+
- 寮€锛歚/ladder on`锛堢珛鍗崇敓鏁堬紝涓嶇敤閲嶅惎锛夛紱鍏筹細`/ladder off`锛涚湅鐘舵€侊細`/ladder status`
|
|
105
|
+
- 涔熷彲浠ュ湪 profile 鐨?`cordis.patch.yml` 閲岀粰鏈彃浠惰鍐?`config: { ladder: true }` 浣滀负鍒濆鐘舵€?- 鍏抽棴鏃惰皟鐢ㄦ褰㈠浘宸ュ叿鍙洖涓€琛屽紑鍚彁绀猴紱瑙g爜浜х墿鐓у父
|
|
106
|
+
- 鍓嶄笁娆¤В鐮佷細鍦ㄧ粨鏋滄湯灏炬彁绀恒€岃繖涓伐绋嬪彲浠ュ嚭姊舰鍥俱€嶏紙绗?1/3銆?/3銆?/3 娆★級锛屼箣鍚庝笉鍐嶆彁绀猴紱寮€鍏充笌鎻愮ず璁℃暟璁板湪 `$DSH_HOME/ladder-state.json`
|
|
118
107
|
|
|
119
|
-
|
|
108
|
+
### 鏀瑰綊妗e湴鍧€锛堜笉鐢ㄦ敼浠g爜锛?
|
|
109
|
+
鍦?DSH profile 鐨?`cordis.patch.yml`锛坄$DSH_HOME/profiles/<profile>/cordis.patch.yml`锛夋湯灏剧粰鏈彃浠堕偅涓€琛屽姞 config锛堝彧鍐?`archiveDir`锛氬綊妗f牴鐩綍锛夛細
|
|
120
110
|
|
|
121
|
-
## 已知边界
|
|
122
111
|
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
- `.smart` 的串/并联拓扑由指令记录还原,已用官方导出的 STL 逐网络回归验证;库调用区(无标准盒头)不在覆盖范围内。
|
|
127
|
-
- 指令名带 `?`(如 `?DRVI`)是推断名,报告末尾有推断对照表;`??xx` 是未定名,保持原样。
|
|
112
|
+
`archiveDir` 鏄綊妗?*鏍圭洰褰?*锛氱浉瀵硅矾寰勬寜褰撳墠浼氳瘽宸ヤ綔鍖鸿В鏋愶紝缁濆璺緞鍘熸牱浣跨敤锛涢粯璁?`瑙g爜褰掓。`銆傛敼瀹岄噸鍚?dsh 鐢熸晥锛宍/plc-archive` 鍙殢鏃舵煡鐪嬪綋鍓嶇敓鏁堝€硷紱鍙兂鏀逛竴娆″氨鍦ㄨВ鐮佹椂浼?`outDir`銆?
|
|
113
|
+
`.smart` 鐨?`璁板綍.json` 鍚屾椂鏄悇鍒嗘瀽宸ュ叿锛堝湴鍧€鍗犵敤銆佸彉閲忎娇鐢ㄧ瓑锛夌殑杈撳叆锛屼篃鏄瘑鍒€屽凡瑙g爜鐩綍銆嶇殑鍑嵁锛涜В鐮佹姤鍛婂ご閮ㄥ甫**婧愭枃浠舵寚绾?*锛堟枃浠跺ぇ灏?+ 淇敼鏃堕棿锛夛紝宸ョ▼鎹㈢増鏈悗鍏堟牳瀵规寚绾瑰啀鐢ㄦ棫鎶ュ憡銆?
|
|
114
|
+
## 宸茬煡杈圭晫
|
|
128
115
|
|
|
129
|
-
|
|
116
|
+
- 瑙︽懜灞忓伐绋嬶細`.hmismart` 閲屽彧鏈夋ā鏉块鏋讹紝鐪熷疄鐢婚潰涓庢帶浠跺湪鏃佺郴 `{{GUID}}.data`锛圗S2RT 搴忓垪鍖栨祦锛夛紝鍙橀噺鍚嶄笌鎺т欢鍚嶈兘瑙o紝鎺т欢鍒板彉閲忕殑寮曠敤鍙В鍑哄悓娈靛叡鐜颁笌 UUID 鍛戒腑閭i儴鍒嗭紝鍏朵綑鏍囥€屾湭瑙e嚭銆嶏紱绻佹槗宸ョ▼鑻ユ病寤哄彉閲忥紝鎺т欢鍦板潃鍙湪 `Bin\fshmi.bin` 鐨勫姩浣滆〃閲岋紱鏄嗕粦閫氭€佸伐绋嬮渶鏈満鏈?`.mcp` 鏍锋湰鎵嶈兘楠岃瘉銆?- 濞佺憾閫?EasyBuilder Pro锛歚.emtp` 鏈綋鍘嬬缉+鍔犲瘑锛岃涓嶅嚭缁撴瀯锛屽彧鑳藉彇鍚屽伐绋嬬紪璇戜骇鐗?`.exob`锛涜〃鍙嶆槧**缂栬瘧閭d竴鍒?*鐨勫伐绋嬶紙宸ョ▼鏀硅繃娌¢噸鏂扮紪璇戝氨鍏堢紪璇戝啀璺戯級銆傜紪璇戜骇鐗╅噷鍙湁婧愯瑷€銆佹病鏈夎瘧鏂囥€傜敾闈㈠綊灞炴寜瀵硅薄娴佸垎娈垫帹瀹氾紝琛ㄩ噷鐨?x/y/w/h 鏄瓧涓插妗嗗害閲忎笉鏄敾闈㈠潗鏍囥€?- 搴撳潡璋冪敤鍖猴紙濡?MBUS_MSG 鐨?Slave / RW / Addr / Count / DataPtr锛夌殑寮曡剼绾у疄鍙傝В涓嶅嚭锛屽伐鍏蜂細鏄庣‘璇存槑锛屼笉鐚溿€?- 鍔犲瘑鎴栫壒娈婂帇缂╃殑宸ョ▼鍙兘瑙d笉鍑猴紱瑙g爜鍣ㄤ細鎶ラ敊鑰屼笉鏄粰鍑哄崐鐪熺粨鏋溿€?- `.smart` 鐨勪覆/骞惰仈鎷撴墤鐢辨寚浠よ褰曡繕鍘燂紝宸茬敤瀹樻柟瀵煎嚭鐨?STL 閫愮綉缁滃洖褰掗獙璇侊紱搴撹皟鐢ㄥ尯锛堟棤鏍囧噯鐩掑ご锛変笉鍦ㄨ鐩栬寖鍥村唴銆?- 鎸囦护鍚嶅甫 `?`锛堝 `?DRVI`锛夋槸鎺ㄦ柇鍚嶏紝鎶ュ憡鏈熬鏈夋帹鏂鐓ц〃锛沗??xx` 鏄湭瀹氬悕锛屼繚鎸佸師鏍枫€?
|
|
117
|
+
## 寮€鍙戜笌鑷
|
|
130
118
|
|
|
131
119
|
```sh
|
|
132
|
-
npm run check #
|
|
133
|
-
npm run smoke
|
|
134
|
-
npm
|
|
135
|
-
npm pack --dry-run # 看包里内容(node_modules、publish/ 不应进包)
|
|
136
|
-
```
|
|
120
|
+
npm run check # 璇硶妫€鏌?npm run smoke # 瑁呰浇鎻掍欢 + 鏍稿娉ㄥ唽闈紙宸ュ叿 19 涓?/ 鍛戒护 20 涓級
|
|
121
|
+
npm run smoke -- <宸ョ▼鏂囦欢> # 棰濆瀵逛竴涓湡瀹炲伐绋嬭窇绔埌绔В鐮侊紝鏍稿浜х墿钀界洏
|
|
122
|
+
npm pack --dry-run # 鐪嬪寘閲屽唴瀹癸紙node_modules銆乸ublish/ 涓嶅簲杩涘寘锛?```
|
|
137
123
|
|
|
138
|
-
##
|
|
124
|
+
## 鐩綍缁撴瀯
|
|
139
125
|
|
|
140
126
|
```
|
|
141
|
-
index.js
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
assets/
|
|
145
|
-
assets/
|
|
146
|
-
assets/smart-
|
|
147
|
-
assets/codesys-tools/ CoDeSys / DVP 解码 Python 脚本(只用标准库)
|
|
148
|
-
assets/hmismart-decode.mjs 西门子 .hmismart 解码器(结构表 + .data 名字/绑定/类型表)
|
|
149
|
-
assets/hmismart-diff.mjs .hmismart 新旧对比
|
|
150
|
-
assets/fstudio-tables.py 繁易画面 / 控件 / 控件地址表
|
|
151
|
-
assets/nb-decode.mjs 欧姆龙 NB-Designer 解码器
|
|
152
|
-
assets/mcgs-decode.mjs 昆仑通态 MCGS / LSTP 解码器
|
|
153
|
-
scripts/smoke.mjs 冒烟测试
|
|
127
|
+
index.js 鎻掍欢鍏ュ彛锛氬伐鍏蜂笌鍛戒护娉ㄥ唽銆佸洓鏍煎紡鍒嗗彂銆丼MART 瑙g爜鍣?hmi.js 瑙︽懜灞忚В鐮佹ā鍧楋紙宸ュ叿/鍛戒护/鎶€鑳芥敞鍐岋紝鐢?index.js 璋冪敤锛?ladder.js 姊舰鍥炬覆鏌?鑷姩鎴愬浘妯″潡锛堥粯璁ゅ叧闂紝/ladder on 鎵撳紑锛岀敱 index.js 璋冪敤锛?assets/decode-pack.mjs 瑙g爜浜х墿钀界洏锛堢储寮?鐩綍/琛ㄦ牸/璁板綍锛?assets/smart-lad.mjs 杩炵嚎杩樺師鑴氭湰锛堢敱 smart-lad 宸ュ叿璋冪敤锛?assets/smart-net-trace.mjs 缃戠粶杞ㄨ抗鑴氭湰锛堢敱 smart-net-trace 宸ュ叿璋冪敤锛?assets/codesys-tools/ CoDeSys / DVP 瑙g爜 Python 鑴氭湰锛堝彧鐢ㄦ爣鍑嗗簱锛?assets/hmismart-decode.mjs 瑗块棬瀛?.hmismart 瑙g爜鍣紙缁撴瀯琛?+ .data 鍚嶅瓧/缁戝畾/绫诲瀷琛級
|
|
128
|
+
assets/hmismart-report.mjs .hmismart 浜鸿鎶ュ憡锛堢敾闈?鍙橀噺/杩炴帴/鍏冧欢鍒嗙被锛?assets/hmismart-diff.mjs .hmismart 鏂版棫瀵规瘮
|
|
129
|
+
assets/fstudio-tables.py 绻佹槗鐢婚潰 / 鎺т欢 / 鎺т欢鍦板潃琛?assets/fstudio_i18n.py 绻佹槗鍏冧欢鏂囨湰鎵弿锛堟寜璇鍒嗘Ы锛?assets/hmi-decode-workflow.md 瑙︽懜灞忚鍙栧伐浣滄祦锛堟妧鑳芥鏂囷級
|
|
130
|
+
assets/ladder-workflow.md 梯形图技能(排版规范、自动成图、交付前自检)
|
|
131
|
+
assets/nb-decode.mjs 娆у榫?NB-Designer 瑙g爜鍣?assets/mcgs-decode.mjs 鏄嗕粦閫氭€?MCGS / LSTP 瑙g爜鍣?assets/ebpro-decode.mjs 濞佺憾閫?EBpro 瑙g爜锛堣 .exob锛氱敾闈?/ 鏂囧瓧瀵硅薄 / 鎶ヨ浜嬩欢 / 鏂囧瓧搴擄級
|
|
132
|
+
assets/ladder-render.mjs 鏂囧瓧姊舰鍥炬覆鏌撳櫒锛堝浐瀹氱増寮忥紝鐢?ladder-render 璋冪敤锛?assets/stl-to-ladder.mjs 璇彞琛ㄨ浆姊舰鍥撅紙鐢?ladder-from-stl 璋冪敤锛?assets/smart-ladder-auto.mjs .smart 鑷姩鎴愬浘锛堢敱 ladder-auto 璋冪敤锛?assets/dvp-ladder.mjs .dvp 鑷姩鎴愬浘锛堢敱 ladder-dvp 璋冪敤锛?scripts/smoke.mjs 鍐掔儫娴嬭瘯
|
|
154
133
|
```
|
|
155
134
|
|
|
156
|
-
##
|
|
157
|
-
|
|
158
|
-
插件有问题,按这个顺序:
|
|
159
|
-
|
|
160
|
-
1. 开 Issue:https://github.com/taoziliyouchong/dsh-plc-decode/issues —— 能留痕、能搜历史,别人也可能已经遇过;
|
|
161
|
-
2. 急着问或不想开 Issue,QQ 号:**2171960697**(加好友请注明装的是哪个插件)。
|
|
135
|
+
## 鍙嶉
|
|
162
136
|
|
|
163
|
-
|
|
137
|
+
鎻掍欢鏈夐棶棰橈紝鎸夎繖涓『搴忥細
|
|
164
138
|
|
|
165
|
-
|
|
139
|
+
1. 寮€ Issue锛歨ttps://github.com/taoziliyouchong/dsh-plc-decode/issues 鈥斺€?鑳界暀鐥曘€佽兘鎼滃巻鍙诧紝鍒汉涔熷彲鑳藉凡缁忛亣杩囷紱
|
|
140
|
+
2. 鎬ョ潃闂垨涓嶆兂寮€ Issue锛孮Q 鍙凤細**2171960697**锛堝姞濂藉弸璇锋敞鏄庤鐨勬槸鍝釜鎻掍欢锛夈€?
|
|
141
|
+
鍙嶉鏃跺甫涓婏細DSH 鐗堟湰銆佹彃浠剁増鏈€佹姤閿欏師鏂囥€佹埅鍥俱€傚皯涓€鏍峰鍗婅鍐嶉棶涓€杞€?
|
|
142
|
+
## 璁稿彲
|
|
166
143
|
|
|
167
144
|
MIT
|