Skip to content

Commit 1bd6af0

Browse files
committed
Bump to version 0.2.4
--- + Update documentation for iedctrl.py
1 parent 8c1774b commit 1bd6af0

8 files changed

Lines changed: 53 additions & 23 deletions

File tree

docs/source/changelog.rst

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,18 @@
44
Changelog
55
=========
66

7+
8+
.. _v0.2.4:
9+
10+
v0.2.4 :bdg-info:`beta-develop`
11+
----------------------------------
12+
13+
**Added**
14+
15+
- Example to control IEDs: ``iedctrl.py``
16+
- Add ``put`` command to ``mmsclient.py`` to transfer files to a MMS remote server
17+
- Add implementation to control IEDs
18+
719
.. _v0.2.3:
820

921
v0.2.3 :bdg-info:`beta-develop`
55.3 KB
Loading
53.4 KB
Loading

docs/source/protocols/iec61850/iedctrl.rst

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -20,25 +20,11 @@ Examples
2020

2121
Operate a control object with a specific value:
2222

23-
.. code-block::
24-
25-
iedctrl.py -t 'simpleIOGenericIO/GGIO1.SPCSO3' --value true --check 127.0.0.1
26-
[I] Associating MMS environment with peer 127.0.0.1:102...
27-
[I] Control model for node: DIRECT_ENHANCED
28-
[I] Value will be changed to: True
29-
[I] Successfully completed operation on SPCSO3!
30-
Current value: TRUE
23+
.. image:: _images/iedctrl-operw.png
3124

3225
Toggle a boolean control object:
3326

34-
.. code-block::
35-
36-
iedctrl.py -t 'simpleIOGenericIO/GGIO1.SPCSO4' --toggle --check 127.0.0.1
37-
[I] Associating MMS environment with peer 127.0.0.1:102...
38-
[I] Control model for node: SBO_ENHANCED
39-
[I] Value will be changed from FALSE -> TRUE
40-
[I] Successfully completed operation on SPCSO4!
41-
Current value: TRUE
27+
.. image:: _images/iedctrl-opertoggle.png
4228

4329
Notes
4430
-----
99.7 KB
Loading

docs/source/protocols/mms/demo_files.rst

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,25 @@ You will be dropped into an interactive shell similar to this:
3535
mmsclient.py <host> ls
3636
3737
38+
.. tip::
39+
40+
To view the help message for each implemented command, use ``--help``
41+
together with the command:
42+
43+
.. code-block:: bash
44+
45+
mmsclient.py --help ls
46+
Usage: ls [-h] [-l] [-a] [directory]
47+
48+
positional arguments:
49+
directory Remote directory to list (defaults to current remote directory)
50+
51+
optional arguments:
52+
-h, --help show this help message and exit
53+
-l Print output as a list (table) instead of filenames only
54+
-a, --all List all files, including ones in subdirectories
55+
56+
3857
Listing Files (``ls``)
3958
----------------------
4059
@@ -100,6 +119,19 @@ Arguments:
100119
.. image:: _images/mms-file-get.png
101120
102121
122+
Uploading Files (``put``)
123+
---------------------------
124+
125+
The :code:`put` command transfers a local file to the remote MMS peer.
126+
127+
Arguments:
128+
129+
- ``local_name`` :octicon:`arrow-right` The local file name to transfer.
130+
- ``remote_name`` :octicon:`arrow-right` The file name on the remote MMS peer (optional).
131+
132+
.. image:: _images/mms-file-put.png
133+
134+
103135
Deleting Files (``del``)
104136
------------------------
105137

src/icspacket/examples/iedctrl.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -188,12 +188,12 @@ def cli_main():
188188
logging.debug("Direct Control Nodel: Writing value...")
189189
error = client.operate(co, ctl_val=args.var_value)
190190
if error:
191-
logging.error("Failed to start opertation: %s", error.value)
191+
logging.error("Failed to start opertation: %s", repr(error.value))
192192
sys.exit(1)
193193

194194
case ControlModel.DIRECT_ENHANCED:
195195
if error := client.operate(co, ctl_val=args.var_value):
196-
logging.error("Failed to start opertation: %s", error.value)
196+
logging.error("Failed to start opertation: %s", repr(error.value))
197197
sys.exit(1)
198198

199199
with args.console.status("Waiting for operation to complete..."):
@@ -202,21 +202,21 @@ def cli_main():
202202
case ControlModel.SBO_NORMAL:
203203
logging.debug("Selecting node before operation (SBO)...")
204204
if error := client.select(co):
205-
logging.error("Failed to select node: %s", error.value)
205+
logging.error("Failed to select node: %s", repr(error.value))
206206
sys.exit(1)
207207

208208
if error := client.operate(co, ctl_val=args.var_value):
209-
logging.error("Failed to start opertation: %s", error.value)
209+
logging.error("Failed to start opertation: %s", repr(error.value))
210210
sys.exit(1)
211211

212212
case ControlModel.SBO_ENHANCED:
213213
logging.debug("Selecting node with value before operation (SBOw)...")
214214
if error := client.select_with_value(co, ctl_val=args.var_value):
215-
logging.error("Failed to select node: %s", error.value)
215+
logging.error("Failed to select node: %s", repr(error.value))
216216
sys.exit(1)
217217

218218
if error := client.operate(co, ctl_val=args.var_value):
219-
logging.error("Failed to start opertation: %s", error.value)
219+
logging.error("Failed to start opertation: %s", repr(error.value))
220220
sys.exit(1)
221221

222222
with args.console.status("Waiting for operation to complete..."):

src/icspacket/proto/iec61850/control.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ def get_operate_data(
249249
}
250250
]
251251
if self.has_time_activated_oper:
252-
ts = oper_time or Timestamp.from_datetime(datetime.datetime.now())
252+
ts = oper_time or bytes(8)
253253
# operTm = <CO_CtrlObjectRef>$Oper$operTm
254254
items.append({"utc_time": bytes(ts)})
255255

0 commit comments

Comments
 (0)