DiamondLightSource / DiamondLightSource/dodal

Expand Linkam to make use of values from Status.

Open
#338 0 comments 0 reactions 0 assignees View on GitHub
enhancement i22
Dominant language
Python
Stars
5
Forks
13
Avg merge
3d 2h
Merged PRs (30d)
10

Description

Linkam controller exposes values on its status. If these can be wrapped with signals, they can be exposed as Configuration data that may be useful.

Observed when expanding the i22 Linkam implementation to a more complete model.

```python
# TODO: read this field out
# status is a bitfield stored in a double
self.status = epics_signal_r(float, prefix + "STATUS:")

# TODO: Make use of values in Status.
async def _is_nth_bit_set(self, n: int) -> bool:
return bool(int(await self.status.get_value()) & 1 << n)

async def in_error(self) -> bool:
return await self._is_nth_bit_set(0)

async def at_setpoint(self) -> bool:
return await self._is_nth_bit_set(1)

async def heater_on(self) -> bool:
return await self._is_nth_bit_set(2)

async def pump_on(self) -> bool:
return await self._is_nth_bit_set(3)

async def pump_auto(self) -> bool:
return await self._is_nth_bit_set(4)
```

## Acceptance Criteria
* Linkam3 can be instantiated that exposes fields from its status to Bluesky control and data export.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.