Skip to content

Commit f843686

Browse files
committed
Add changes from draft_wip missed when splitting spec
1 parent a9bfd17 commit f843686

File tree

5 files changed

+67
-37
lines changed

5 files changed

+67
-37
lines changed

protocol/specification/datainfo.rst

Lines changed: 25 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ to pinpoint the exact meaning of the data to be described.
1212
SECoP defines some basic data types for numeric quantities, like double_,
1313
scaled_ and int_. An enum_ is defined for convenience of not having to remember
1414
the meaning of values from a reduced set. A bool_ datatype is similar to a
15-
predefined Enum, but uses the JSON values true and false. For non-numeric
16-
types, a string_ and a blob_ are defined as well. Finally, matrix_ can
17-
transport larger multi-dimensional homogeneous arrays.
15+
predefined enum, but uses the JSON values ``true`` and ``false``. For
16+
non-numeric types, a string_ and a blob_ are defined as well. Finally, matrix_
17+
can transport larger multi-dimensional homogeneous arrays.
1818

1919
Furthermore, SECoP not only defines basic data types, but also structured
2020
datatypes. tuple_ allows aggregation of a fixed amount of values with different
@@ -69,6 +69,18 @@ Related issue: :issue:`042 Requirements of datatypes`
6969
``"max"``
7070
Upper limit. If ``max`` is omitted, there is no upper limit.
7171

72+
.. note::
73+
74+
When a SEC Node receives a ``"change"`` or ``"do"`` message with a value
75+
outside the allowed range [``"min"``, ``"max"``], it MUST reply with an
76+
error message. For readonly parameters, [``"min"``, ``"max"``] indicate a
77+
trusted range. A SEC-Node might send ``"update"`` or ``"reply"`` messages
78+
with values outside the trusted range, for example when the value is an
79+
extrapolation of the calibrated range. The idea behind this relaxed rule is,
80+
that it is better for a SEC-node to send an acquired value outside the range
81+
as it is - rather than change its value just to comply with the specified
82+
range. The decision, how to treat such values is left to the ECS.
83+
7284
``"unit"``
7385
String giving the unit of the parameter.
7486

@@ -138,11 +150,13 @@ Related issue: :issue:`044 Scaled integers`
138150
``"min"``, ``"max"``
139151
The limits of the transported integer, ``min <= max``. The limits of the
140152
represented floating point value are ``min*scale`` and ``max*scale``.
153+
See also the note on the ``"min"`` and ``"max"`` properties of the
154+
:ref:`float` datatype.
141155

142156
.. rubric:: Optional data properties
143157

144158
``"unit"``
145-
String giving the unit of the paramete, as for double_.
159+
String giving the unit of the parameter, as for double_.
146160

147161
``"absolute_resolution"``
148162
A JSON number specifying the smallest difference between distinct values.
@@ -189,6 +203,8 @@ with 32bit float too.
189203

190204
``"min"``, ``"max"``
191205
Integer limits, ``<min>`` <= ``<max>``.
206+
See also the note on the ``"min"`` and ``"max"`` properties of the
207+
:ref:`float` datatype.
192208

193209
.. rubric:: Optional data properties
194210

@@ -235,7 +251,7 @@ Datatype to be used for values that can only have a set of predefined values.
235251
.. rubric:: Mandatory data property
236252

237253
``"members"``
238-
A JSON object giving all possible values: ``{<name>: <value>, ....}``
254+
A JSON object giving all possible values: ``{<name>: <value>, ...}``
239255

240256
``name``\ s are strings, ``value``\ s are (preferably small) integers. Both
241257
``name``\ s and ``value``\ s MUST be unique within an enum.
@@ -248,7 +264,7 @@ Datatype to be used for values that can only have a set of predefined values.
248264
249265
.. rubric:: Transport
250266

251-
As a JSON-number. The client may perform a mapping back to the name.
267+
As a JSON number. The client may perform a mapping back to the name.
252268

253269
Example: ``200``
254270

@@ -391,10 +407,10 @@ value.
391407
``"optional"``
392408
A JSON list giving the names of optional struct elements.
393409

394-
In 'change' and 'do' commands, the ECS might omit these elements, all other
395-
elements must be given. The effect of a 'change' action with omitted
410+
In `change` and `do` commands, the ECS might omit these elements, all other
411+
elements must be given. The effect of a `change` action with omitted
396412
elements should be the same as if the current values of these elements would
397-
have been sent with it. The effect of a 'do' action with omitted elements
413+
have been sent with it. The effect of a `do` action with omitted elements
398414
is defined by the implementation.
399415

400416
In all other messages (i.e. in replies and updates), all elements have to be

protocol/specification/descriptive.rst

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -109,9 +109,9 @@ Optional Module Properties
109109
~~~~~~~~~~~~~~~~~~~~~~~~~~
110110

111111
``"visibility"``
112-
A string indicating a hint for UIs, for which user roles the module should be
113-
displayed, hidden or allow read access only.
114-
MUST be one of the values on the two visibility columns. The default is "www".
112+
A string giving a hint for UIs, for which user roles the module should be
113+
displayed, hidden or allow read access only. MUST be one of the values on
114+
the two visibility columns. The default is ``"www"``.
115115

116116
.. table:: possible combinations of access hints
117117

@@ -142,7 +142,7 @@ Optional Module Properties
142142
* A module with visibility "---" is meant not to be shown in a user interface,
143143
but might still be used by the client interface internally.
144144

145-
.. note:: The access is NOT controlled on the SECnode side! The visibility property is just a
145+
.. note:: The access is NOT controlled on the SEC node side! The visibility property is just a
146146
hint to the UI (client) what should be exposed to (or better hidden from) the users
147147
having different levels of expertise.
148148
The UI (client) should implement the different access levels.
@@ -261,13 +261,24 @@ Optional Module Properties
261261
.. _implementor:
262262

263263
``"implementor"``
264-
An optional string giving the implementor of a module, defining the meaning
264+
A string giving the implementor of a module, defining the meaning
265265
of custom status values, custom properties and custom accessibles. The
266266
implementor must be globally unique, for example 'sinq.psi.ch'. This may
267267
be achieved by including a domain name, but it does not need to be a
268268
registered name, and other means of assuring a global unique name are also
269269
possible.
270270

271+
``"implementation"``
272+
A string indicating information about the implementation of the
273+
module, like a Python class.
274+
275+
Example: ``"secop_psi.ppms.Field"``
276+
277+
``"features"``
278+
A list of supported features of a module.
279+
280+
Example: ``["HasOffset"]``
281+
271282

272283
Accessible Description
273284
----------------------
@@ -319,9 +330,9 @@ Optional Accessible Properties
319330
for grouping of modules within a node.
320331

321332
``"visibility"``
322-
A string indicating a hint for UIs, for which user roles the accessible should be
323-
displayed, hidden or allow read access only.
324-
MUST be one of the values on the two visibility columns. The default is "www".
333+
A string giving a hint for UIs, for which user roles the accessible should
334+
be displayed, hidden or allow read access only. MUST be one of the values
335+
on the two visibility columns. The default is ``"www"``.
325336

326337
.. table::
327338

protocol/specification/intro.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ Other requirements
5252
- The protocol should be defined in way that allows a maximum **compatibility**:
5353
Newer and older versions of the syntax should be compatible.
5454

55-
- The protocol should be defined in a way that allows maximum **flexibility**:
56-
A simple (= with minimal features) ECS implementation should be able to
57-
communicate with a complex SEC node (with a lot of features), and an ECS with
58-
a rich number of features should be able to cope with a simple SEC node,
59-
implementing only a minimum number of features/functionality.
55+
- The protocol should be defined in a way that allows maximum **flexibility**: A
56+
simple (= equipped with minimal functionality) ECS implementation should be
57+
able to communicate with a complex SEC node (with wide-ranging functionality),
58+
and an ECS with extensive functionality should be able to deal with a simple
59+
SEC node that implements only a minimum of features.

protocol/specification/messages.rst

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -588,24 +588,26 @@ Example:
588588
.. code::
589589
590590
> read tx:target
591-
< error_read tx:target ["NoSuchModule","tx is not configured on this SEC node", {}]
591+
< error_read tx:target ["NoSuchModule", "tx is not configured on this SEC node", {}]
592592
> change ts:target 12
593-
< error_change ts:target ["NoSuchParameter","ts has no parameter target", {}]
593+
< error_change ts:target ["NoSuchParameter", "ts has no parameter target", {}]
594594
> change t:target -9
595-
< error_change t:target ["BadValue","requested value (-9) is outside limits (0..300)", {}]
595+
< error_change t:target ["RangeError", "requested value (-9) is outside limits (0..300)", {}]
596596
> meas:volt?
597-
< error_meas:volt? ["ProtocolError","unknown action", {}]
597+
< error_meas:volt? ["ProtocolError", "unknown action", {}]
598598
599599
600600
.. _error-classes:
601601

602602
_`Error Classes`:
603603
Error classes are divided into two groups: persisting errors and retryable
604604
errors. Persisting errors will yield the exact same error message if the
605-
exact same request is sent at any later time. A retryable error may give
606-
different results if the exact same message is sent at a later time, i.e.
607-
depends on state information internal to either the SEC node, the module or
608-
the connected hardware.
605+
exact same request is sent at a later time without other interactions
606+
inbetween.
607+
608+
A retryable error may give different results if the exact same message is
609+
sent at a later time, i.e. depends on state information internal to either
610+
the SEC node, the module or the connected hardware.
609611

610612
.. list-table:: Persisting errors
611613
:widths: 20 80

protocol/specification/modules.rst

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ Definition: Command
6464
ECS can use them only in a general way, as their meaning is not known.
6565

6666
The following section describes the currently predefined accessibles, this list
67-
will be extended continuously.
67+
will be extended in new versions.
6868

6969

7070
Basic Parameters
@@ -109,11 +109,12 @@ Command ``"stop"``
109109
Command ``"go"``
110110
Optional command for starting an action. If the ``go`` command is present,
111111
changing any parameter (especially the 'target' parameter) does not yet
112-
initiate any action leading to a BUSY state. In contrast, if no 'go'
113-
command is present, changing the target will start an action trying to
114-
change the value to get closer to the target, which usually leads to a BUSY
115-
state. Changing any parameter, which has an impact on measured values,
116-
should be executed immediately.
112+
initiate any action leading to a ``BUSY`` state.
113+
114+
In contrast, if no 'go' command is present, changing the target will start
115+
an action trying to change the value to get closer to the target, which
116+
usually leads to a BUSY state. Changing any parameter, which has an impact
117+
on measured values, should be executed immediately.
117118

118119
Command ``"hold"``
119120
Optional command on a drivable. Stay more or less where you are, cease
@@ -600,7 +601,7 @@ functionality in a specific way.
600601
module with the feature ``"HasOffset"`` must have a parameter ``offset``,
601602
which indicates to all clients that the transmitted raw values for the
602603
parameters ``value`` and ``target`` are to be converted to corrected values
603-
(at the client side) by the following formulas:
604+
(on the client side) by the following formulas:
604605

605606
For reading the parameters ``value`` and ``target``:
606607

0 commit comments

Comments
 (0)