-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathREADME
More file actions
234 lines (173 loc) · 6.55 KB
/
Copy pathREADME
File metadata and controls
234 lines (173 loc) · 6.55 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
# iec61850-cli-client
A command-line IEC 61850 client for reading data values, browsing server
directories, managing report control blocks, subscribing to reports, and
issuing control commands.
## Build
```bash
cargo build --release
```
The binary is produced at `target/release/iec61850-cli-client`.
## General flags
| Flag | Default | Description |
|---|---|---|
| `--host <HOST>` | `localhost` | Server hostname or IP address |
| `-p, --port <PORT>` | `102` | MMS TCP port |
| `-r, --request <REQUEST>` | `get_data_values` | Service to execute (see below) |
Enable debug logging by setting the environment variable:
```bash
RUST_LOG=debug ./iec61850-cli-client ...
```
---
## Requests
### `get_data_values`
Read one or more data attribute values. References follow the pattern
`LogicalDevice/LogicalNode.DataObject.DataAttribute[FC]`.
The functional constraint (FC) defaults to `ST` when omitted.
```bash
# Read a single value (FC defaults to ST)
./iec61850-cli-client --host 192.168.1.10 -r get_data_values \
IEDLD/MMXU1.TotW.mag.f
# Read multiple values with explicit FC
./iec61850-cli-client --host 192.168.1.10 -r get_data_values \
"IEDLD/MMXU1.TotW.mag.f[MX]" \
"IEDLD/MMXU1.TotV.mag.f[MX]"
```
---
### `get_server_directory`
List all logical devices exposed by the server.
```bash
./iec61850-cli-client --host 192.168.1.10 -r get_server_directory
```
---
### `get_logical_device_directory`
List all logical nodes inside a logical device.
```bash
./iec61850-cli-client --host 192.168.1.10 -r get_logical_device_directory IEDLD
```
---
### `get_data_definition`
Retrieve the data definition (structure) of a data object or attribute.
```bash
./iec61850-cli-client --host 192.168.1.10 -r get_data_definition \
"IEDLD/MMXU1.TotW"
```
---
### `get_brcb_values`
Read all attributes of a Buffered Report Control Block (BRCB).
```bash
./iec61850-cli-client --host 192.168.1.10 -r get_brcb_values \
--brcb-ref "IED1LD/LLN0.brcb1"
```
---
### `get_urcb_values`
Read all attributes of an Unbuffered Report Control Block (URCB).
```bash
./iec61850-cli-client --host 192.168.1.10 -r get_urcb_values \
--urcb-ref "IED1LD/LLN0.urcb1"
```
---
### `set_brcb_values`
Write one or more attributes to a BRCB. After writing, the connection is kept
open for 10 seconds to allow observation of incoming reports.
| Flag | Description |
|---|---|
| `--brcb-ref <REF>` | BRCB reference (required) |
| `--rpt-id <ID>` | Report identifier (RptID) |
| `--rpt-ena <true\|false>` | Enable/disable reporting |
| `--dat-set <REF>` | Dataset reference |
| `--buf-tm <MS>` | Buffer time in milliseconds |
| `--intg-pd <MS>` | Integrity period in milliseconds |
| `--gi <true\|false>` | Trigger general interrogation |
| `--purge-buf <true\|false>` | Purge the buffer |
| `--resv-tms <S>` | Reservation time in seconds |
```bash
# Enable reporting and trigger a general interrogation
./iec61850-cli-client --host 192.168.1.10 -r set_brcb_values \
--brcb-ref "IED1LD/LLN0.brcb1" \
--rpt-ena true \
--gi true
```
---
### `set_urcb_values`
Write one or more attributes to a URCB. After writing, the connection is kept
open for 10 seconds to allow observation of incoming reports.
All BRCB flags above are also available, plus:
| Flag | Description |
|---|---|
| `--urcb-ref <REF>` | URCB reference (required) |
| `--resv <true\|false>` | Reserve the URCB for exclusive use |
| `--opt-seq-num <true\|false>` | OptFlds: sequence number |
| `--opt-time-stamp <true\|false>` | OptFlds: report timestamp |
| `--opt-reason <true\|false>` | OptFlds: reason for inclusion |
| `--opt-dat-set-name <true\|false>` | OptFlds: dataset name |
| `--opt-data-ref <true\|false>` | OptFlds: data reference |
| `--opt-conf-rev <true\|false>` | OptFlds: configuration revision |
| `--opt-segmentation <true\|false>` | OptFlds: segmentation |
```bash
# Reserve the URCB and enable timestamp + reason in reports
./iec61850-cli-client --host 192.168.1.10 -r set_urcb_values \
--urcb-ref "IED1LD/LLN0.urcb1" \
--resv true \
--rpt-ena true \
--opt-time-stamp true \
--opt-reason true
```
---
### `subscribe_report`
Enable reporting on a control block and print incoming reports for 10 seconds.
| Flag | Description |
|---|---|
| `--cb-ref <REF>` | Control block reference (required) |
| `--report-type <TYPE>` | `buffered` or `unbuffered` (required) |
```bash
# Subscribe to a buffered report control block
./iec61850-cli-client --host 192.168.1.10 -r subscribe_report \
--cb-ref "IED1LD/LLN0.brcb1" \
--report-type buffered
# Subscribe to an unbuffered report control block
./iec61850-cli-client --host 192.168.1.10 -r subscribe_report \
--cb-ref "IED1LD/LLN0.urcb1" \
--report-type unbuffered
```
---
### `control`
Issue a control command using one of the four IEC 61850 control models.
| Flag | Description |
|---|---|
| `--co-ref <REF>` | Control object reference, e.g. `IED1LD/CSWI1.Pos` (required) |
| `--control-model <MODEL>` | One of the four models below (required) |
| `--ctl-val <VALUE>` | Control value (required, see formats below) |
| `--oper-timeout <S>` | Seconds to wait for CommandTermination (enhanced-security models, default: 10) |
**Control models**
| Value | Description |
|---|---|
| `direct_with_normal_security` | Single operate, no select, no termination |
| `direct_with_enhanced_security` | Single operate, waits for CommandTermination |
| `sbo_with_normal_security` | Select then operate |
| `sbo_with_enhanced_security` | Select-with-value then operate, waits for CommandTermination |
**Control value formats (`--ctl-val`)**
| Format | Data type | Example |
|---|---|---|
| `true` / `false` | SPC / DPC (Boolean) | `--ctl-val true` |
| integer | INC / ENC / ISC (INT32) | `--ctl-val 2` |
| float | APC with float analogue value | `--ctl-val 1.5` |
| `i:<integer>` | APC with integer analogue value | `--ctl-val i:42` |
| `stop` / `lower` / `higher` / `reserved` | BSC / BAC (BinaryStep) | `--ctl-val lower` |
```bash
# Direct control (normal security) — open a switch
./iec61850-cli-client --host 192.168.1.10 -r control \
--co-ref "IED1LD/CSWI1.Pos" \
--control-model direct_with_normal_security \
--ctl-val true
# SBO with enhanced security — close a switch, wait up to 15 s for termination
./iec61850-cli-client --host 192.168.1.10 -r control \
--co-ref "IED1LD/CSWI1.Pos" \
--control-model sbo_with_enhanced_security \
--ctl-val false \
--oper-timeout 15
# Step control — raise a tap changer
./iec61850-cli-client --host 192.168.1.10 -r control \
--co-ref "IED1LD/ATCC1.TapPos" \
--control-model direct_with_normal_security \
--ctl-val higher
```