You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
o2-alf-lib-client is the binary of an ALF SC library client used solely for testing purposes. It expects parameters for the SC modules to test, the card and link ID (run with `--help` for the different options).
31
+
32
+
`
33
+
o2-alf-lib-client --card-id=#1 --link-id=0 --swt
34
+
`
35
+
36
+
## DIM Services
30
37
31
38
Service names are identified by the server's hostname, the card's sequence number (as reported during ALF's startup) and the link, as follows:
32
39
@@ -188,3 +195,64 @@ The services are DIM RPC services. Every RPC is called with a string and expects
188
195
* Example:
189
196
* DIM input `0xf00d\n0x0000f00d, 0x0000beef\n0x0000f00d`
190
197
* DIM output `0xcafe\n0\n0xbeef\n`
198
+
199
+
## Slow Control library
200
+
ALF can also be used as a C++ library to access the Slow Control interface of the CRU. The three available interfaces (IC, SCA & SWT) can be accessed through single operations, or sequences of operations.
201
+
202
+
For each Slow Control (SC) class a handle can be acquired by passing the card ID as an `std::string` argument and, optionally, the SC channel to use as an `int`. Constructors have no side-effects; an SC reset would need to be performed manually before starting operations (e.g. `swt.reset()`).
203
+
204
+
### Single operations
205
+
Depending on the type, an SC class offers a different interface for single operation execution. `SWT` and `IC` offer `read()` and `write()` standalone operations, while `SCA` only offers `executeCommand()`.
206
+
207
+
All the above offer **no implicit locking** and should be manually locked through the use of the [LLA](https://github.com/AliceO2Group/LLA) library, if needed. The recommended way to execute atomic operations in one go is the one described in the following paragraph.
208
+
209
+
### Sequences of operations
210
+
All SC classes offer a function to execute a sequence of their respective operations. This function receives an `std::vector`, consisting of an `std::pair` made up of the compatible SC operation and SC data, as these are defined in their headers.
211
+
212
+
For example, `SWT` offers `Read, Write and Reset` operations which expect a `TimeOut`, an `SwtWord` and no argument, respectively.
213
+
214
+
```
215
+
typedef int TimeOut;
216
+
217
+
/// Typedef for the Data type of an SWT sequence operation.
218
+
/// Variant of TimeOut for reads, SwtWord for writes, std::string for Errors
The above function also optionally accepts a boolean, enabling atomic execution. This should not be used with an explicit LLA session started, as it will lead to a deadlock due to the lack of communication between the ALF library and the aforementioned LLA session instance.
231
+
232
+
233
+
More details and examples on the API can be found in the doxygen docs in the header files or in [this](apps/AlfLibClient.cxx) code example.
234
+
235
+
### Using ALF as a library
236
+
237
+
To use ALF as a library the "Alf/Alf.h" convenience header may be used, as seen in [this](src/example.cxx) example. To build, it is necessary to load the alisw environment (`aliswmod enter ALF`) and run the following g++ command:
0 commit comments