paulscherrerinstitute / pcaspy

Portable Channel Access Server in Python
BSD 3-Clause "New" or "Revised" License
32 stars 24 forks source link

Setting scan to 0 through setParamInfo #99

Open hinxx opened 3 months ago

hinxx commented 3 months ago

I would like to switch between passive and periodic scan. If the PV has initial scan set to non zero for createPV, is it allowed to set it to 0 during the runtime with self.setParamInfo('det1:trig', {'scan': 0})?

If I do that the PV updates, seen by the camonitor, are flooding my console with PV value changing rapidly.

xiaoqiangwang commented 3 months ago

The scan thread is only created on startup, https://github.com/paulscherrerinstitute/pcaspy/blob/f2f59c0e9e8fc8a56ad78d5f1f582e36287cd661/pcaspy/driver.py#L513-L517 So switch from passive to periodic is not possible.

The scan value is directly used to the delay function, https://github.com/paulscherrerinstitute/pcaspy/blob/f2f59c0e9e8fc8a56ad78d5f1f582e36287cd661/pcaspy/driver.py#L532 There is currently no way to stop it.