Some Clarifications Regarding aIn records #72
-
It seems there's a variety of ways to define ioc records and I'm looking to confirm or clarify my understanding thus far. Two main categories are ones using the special PythonIOC device and the lower level ones in builder.records. I defined: ai2 = builder.records.ai('AI2', VAL="5", INP="float1 CP MS", SCAN="Passive", PINI="YES") and updates were seen with a camonitor running in another console. Conversely: ai1 = builder.aIn('AI', initial_value=5, INP="float1 CP MS", SCAN="Passive", PINI="YES") did not update (verified using both caget and camonitor from another console) So, I set up a monitor on float1 (as per the tutorials) and wrote the value from the callback function. Updates still did not go out. I then changed the SCAN to "I/O Intr" for ai2 and updates started going out. Do all these "higher-level" records require SCAN="I/O Intr"? Or should I be updated ai1 via an ao1's on_update handler....? Is there a "best practice" for what I'm attempting? Thanks so much for this intriguing tool/utility!!! It holds a lot of promise for us here. :) |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 3 replies
-
Is PINI meaningful for PVs in this category...? Sorry for all the questions. Trying to get my head around some of the (what seems to be) nuances. |
Beta Was this translation helpful? Give feedback.
-
I should probably leave a full explanation to @Araneidae or @thomascobb , but I can give direct answers based on current code to some of your questions. I'll leave it for others to say if this behaviour is correct and/or could be improved. By default all It sounds like you may have encountered issue #67 , or some variant thereof, if you are seeing records not update in some cases. If it's helpful, you can print out the record database file using |
Beta Was this translation helpful? Give feedback.
-
The other piece of the puzzle to understand is the For records created with the core When a pythonSoftIOC IN record processes the record support code (implemented in For OUT records, the processing code is triggered when the record is modified, and the record's I hope this helps a bit. |
Beta Was this translation helpful? Give feedback.
The other piece of the puzzle to understand is the
DTYP
field and how EPICS record processing works.Every EPICS record has "device support" associated with it: this determines how the fields in the record behave when the record is processed. Device support is implemented in C (or using
ctypes
bindings in pythonSoftIOC) and is bound to each individual EPICS record through theDTYP
field.For records created with the core
builder.records
constructors theDTYP
field is left blank, which means that record support is entirely passive. In other words, when a record processes it does nothing. On the other hand, all thebuilder.*In
andbuilder.*Out
constructors setDTYP
to the bind the record pr…