@@ -73,8 +73,8 @@ System information:
7373
7474hal.is_initialized()::
7575Returns a boolean to indicate whether hal is initialized. The hal is initialized when there is
76- at least one component. If this is not the case, many of the following functions will
77- fail with the error : `Cannot call before creating component`
76+ at least one component. If this is not the case, many of the following functions will throw
77+ a `RuntimeError` exception : `Cannot call before creating component`
7878
7979.Example:
8080[source,python]
@@ -94,14 +94,17 @@ type = hal.get_realtime_type()
9494hal.get_realtime_type()::
9595Returns the type of the running realtime system.
9696Might return `hal.REALTIME_TYPE_UNINITIALIZED` if `rtapi_app` is not running.
97- See xref:_hal_constants[realtime type constants].
97+ See xref:_hal_constants[realtime type constants]. +
98+ Throws a `RuntimeError` exception if HAL is not initialized.
9899
99100hal.component_exists(_name_:string)::
100- Returns a boolean to indicate whether or not the specified component exist at this time.
101+ Returns a boolean to indicate whether or not the specified component exist at this time. +
102+ Throws a `RuntimeError` exception if HAL is not initialized.
101103
102104hal.component_is_ready(_name_:string)::
103105Returns a boolean to indicate whether or not the specified component is in the ready state.
104- Also returns False if the component does not exist.
106+ Also returns False if the component does not exist. +
107+ Throws a `RuntimeError` exception if HAL is not initialized.
105108
106109.Example:
107110[source,python]
@@ -123,7 +126,8 @@ See 'hal.set_msg_level()' and xref:_hal_constants[message constants] for list of
123126hal.new_sig(_name_:string, _type_:enum)::
124127Create a new signal (net) called _name_.
125128The signal can carry information of _type_ content.
126- Returns `True` on success.
129+ Returns `True` on success. +
130+ Throws a `RuntimeError` exception if HAL is not initialized.
127131
128132.Example:
129133[source,python]
@@ -135,7 +139,8 @@ if not hal.new_sig("signalname", hal.HAL_BIT):
135139hal.connect(_pinname_:string, _signame_:string)::
136140Connect the pin _pinname_ to signal _signame_.
137141Both signal and pin must exist and both pin and signal must be of the same type.
138- Returns `True` on success.
142+ Returns `True` on success. +
143+ Throws a `RuntimeError` exception if HAL is not initialized.
139144
140145.Example:
141146[source,python]
@@ -147,7 +152,8 @@ if not hal.connect("mycomp.pinname", "signalname"):
147152hal.disconnect(_pinname_:string, _signame_:string)::
148153Disconnect the pin _pinname_ from signal _signame_.
149154Both signal and pin must exist.
150- Returns `True` on success.
155+ Returns `True` on success. +
156+ Throws a `RuntimeError` exception if HAL is not initialized.
151157
152158.Example:
153159[source,python]
@@ -158,7 +164,8 @@ if not hal.disconnect("mycomp.pinname"):
158164
159165hal.pin_has_writer(_pinname_:string)::
160166Returns `True` if pin with name _pinname_ is attached to a signal and there is at least one writer.
161- Otherwise, `False` is returned.
167+ Otherwise, `False` is returned. +
168+ Throws a `RuntimeError` exception if HAL is not initialized.
162169
163170.Example:
164171[source,python]
@@ -172,8 +179,9 @@ else:
172179hal.set_p(_name_:string, _value_:mixed)::
173180Sets the pin or param called _name_ to _value_.
174181The _name_ is the full name of the pin or param.
175- The search order is pin names first, then parameter names.
182+ The search order is pin names first, then parameter names. +
176183Throws a `RuntimeError` exception if the _name_ is not found. +
184+ Throws a `RuntimeError` exception if HAL is not initialized. +
177185The type of _value_ depends on the type of the pin or param.
178186Integer scalar types may use integers or a textual representation of an integer to set the value.
179187Floating point type may use both integer, floating point and textual representation thereof to set the value.
@@ -195,14 +203,16 @@ The same rules for _value_ apply to 'set_s()' as to 'set_p()'. +
195203 +
196204The 'set_s()' method has one special case when the signal is of type `hal.HAL_PORT` and it is fully connected.
197205In that case, the call uses the _value_ to set the port's queue size and it must be a positive integer.
198- See below xref:_hal_port_pipes[on configuring a port].
206+ See below xref:_hal_port_pipes[on configuring a port]. +
207+ Throws a `RuntimeError` exception if HAL is not initialized.
199208
200209hal.get_value(_name_:string)::
201210Returns the value of the pin, param or signal with _name_, searched in that order.
202211Boolean types return `True` or `False`.
203212Integer scalar types return an integer.
204213Floating point types return a float.
205- A `RuntimeError` exception is thrown if no pin, param or signal is found by that name.
214+ A `RuntimeError` exception is thrown if no pin, param or signal is found by that name. +
215+ Throws a `RuntimeError` exception if HAL is not initialized.
206216
207217.Example:
208218[source,python]
@@ -211,13 +221,16 @@ value = hal.get_value("iocontrol.0.emc-enable-in")
211221----
212222
213223hal.get_info_pins()::
214- Returns a list of dictionary tuples as in `{"NAME":"pinname", "VALUE":<bool|int|float>, "TYPE":<int>, "DIRECTION":<int>}`.
224+ Returns a list of dictionary tuples as in `{"NAME":"pinname", "VALUE":<bool|int|float>, "TYPE":<int>, "DIRECTION":<int>}`. +
225+ Throws a `RuntimeError` exception if HAL is not initialized.
215226
216227hal.get_info_params()::
217- Returns a list of dictionary tuples as in `{"NAME":"paramname", "VALUE":<bool|int|float>, "TYPE":<int>, "DIRECTION":<int>}`.
228+ Returns a list of dictionary tuples as in `{"NAME":"paramname", "VALUE":<bool|int|float>, "TYPE":<int>, "DIRECTION":<int>}`. +
229+ Throws a `RuntimeError` exception if HAL is not initialized.
218230
219231hal.get_info_signals()::
220- Returns a list of dictionary tuples as in `{"NAME":"signame", "VALUE":<bool|int|float>, "TYPE":<int>, "DRIVER":"name"|None}`.
232+ Returns a list of dictionary tuples as in `{"NAME":"signame", "VALUE":<bool|int|float>, "TYPE":<int>, "DRIVER":"name"|None}`. +
233+ Throws a `RuntimeError` exception if HAL is not initialized.
221234
222235.Example:
223236[source,python]
0 commit comments