eeros_architecture:control_system:signals
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| eeros_architecture:control_system:signals [2015/10/14 14:12] – graf | eeros_architecture:control_system:signals [2021/03/03 08:29] (current) – [Reading from Unconnected Inputs] ursgraf | ||
|---|---|---|---|
| Line 6: | Line 6: | ||
| Each element of a signal is characterized by a value, a high precision timestamp, a name and additional properties, depending on the type of signal, which will provide semantic information. Some examples are dimension (e.g. length, mass, current, etc.), SI-unit (e.g. m, m/s, kg, Nm, A, etc.), reference coordinate system or activation state (enabled/ | Each element of a signal is characterized by a value, a high precision timestamp, a name and additional properties, depending on the type of signal, which will provide semantic information. Some examples are dimension (e.g. length, mass, current, etc.), SI-unit (e.g. m, m/s, kg, Nm, A, etc.), reference coordinate system or activation state (enabled/ | ||
| - | {{ signaluml.png? | + | [{{ signaluml.png? |
| It's important to note that a signal can carry a single value as well as a vector or matrix of values. For this purpose the field //value// is declared as of type T. | It's important to note that a signal can carry a single value as well as a vector or matrix of values. For this purpose the field //value// is declared as of type T. | ||
| Signals are used to connect different blocks in the control system and share information between the control system, the sequencer and the safety system. | Signals are used to connect different blocks in the control system and share information between the control system, the sequencer and the safety system. | ||
| + | Supported types for signals are | ||
| + | * Arithmetic (int, double ...) | ||
| + | * Logic (bool) | ||
| + | * Vector (Vector2, Vector3, Vector4) | ||
| + | * Matrix | ||
| + | Each signal can be assigned a name and a unit. All dimensions of a signal share the same name and unit.\\ | ||
| - | ===== Using Signals ===== | + | As an example |
| - | The example | + | |
| <code cpp> | <code cpp> | ||
| - | Gain< | + | Sum<2,Vector3> sum; |
| - | </ | + | sum.setName("adds feedback" |
| + | sum.getOut().getSignal().setName(" | ||
| + | </ | ||
| + | This is shown in the following diagram: | ||
| + | [{{ sumblock.png? | ||
| + | |||
| + | The functions //getIn()// and // | ||
| + | |||
| + | ===== Timestamp ===== | ||
| + | Every signal carries a timestamp. The timestamp of a signal is usually set in input blocks. Block which read from an external source and deliver this value on a output signal will set its timestamp to the time of the acquisition of the value. \\ | ||
| + | Most blocks will not alter this timestamp. However, blocks which depend on the sampling time such as integrators or differentiators will change the timestamp according to their inner algorithm. | ||
| + | |||
| + | ===== Reading from Unconnected Inputs ===== | ||
| + | If you try to read from an input, which is not connected to an output, a // | ||
| - | If a '' | ||
| - | <code cpp> | ||
| - | Gain< | ||
| - | </ | ||
| - | In order to access the individual dimensions of a certain signal, use functions like | ||
| - | <code cpp> | ||
| - | sum.getOut().getValue(); | ||
| - | sum.getOut().getValue(0); | ||
| - | sum.getOut().getValue(2); | ||
| - | sum.getIn(1).getValue(2); | ||
| - | </ | ||
eeros_architecture/control_system/signals.1444824744.txt.gz · Last modified: 2015/10/14 14:12 by graf