-
I'm trying to perform a caput on alarm fields for PVs I created. For aOut PVs, this works as expected. For aIn PVs, they don't seem to change, and caputs return errors. I must be missing something. For instance, using the example code: from softioc import softioc, builder, asyncio_dispatcher
import asyncio
dispatcher = asyncio_dispatcher.AsyncioDispatcher()
builder.SetDeviceName("Test")
ai = builder.aIn('AI', initial_value=5)
ao = builder.aOut('AO', initial_value=12.45, always_update=True,
on_update=lambda v: ai.set(v))
builder.LoadDatabase()
softioc.iocInit(dispatcher)
async def update():
while True:
ai.set(ai.get() + 1)
await asyncio.sleep(1)
dispatcher(update)
softioc.interactive_ioc(globals()) If I use the interactive shell to do a dbpf on each PV, I see I can set the HIHI on the aOut, but not the aIn:
Thanks in advance for your help. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
I think the issue is that for IN records caputs are deliberately disabled, because writing to the Fortunately there is an easy workaround. The disabling is simply done by setting the |
Beta Was this translation helpful? Give feedback.
I think the issue is that for IN records caputs are deliberately disabled, because writing to the
.VAL
field of an IN record is a common mistake that simply doesn't work.Fortunately there is an easy workaround. The disabling is simply done by setting the
.DISP
field to 1 ... and you can caput 0 to this field to turn off the disabling, do your caputs to the alarm fields, and then put.DISP
back to 1 when you're done.