Skip to content

Some Clarifications Regarding aIn records #68

Description

@Robatronic

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"?
Do they also require that the value is manually set in Python (i.e. ai.set(value))......?

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. :)

Activity

  1. Robatronic commented on Dec 11, 2021

    @Robatronic
    Author

    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.

  2. AlexanderWells-diamond commented on Dec 13, 2021

    @AlexanderWells-diamond
    Collaborator

    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 builder.*In records (i.e. every In record type done through the top level API) are created with SCAN='I/O Intr'. (See _in_record(...) in builder.py).
    Immediately following this, if an initial_value is specified PINI will be set to YES.

    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 builder.WriteRecords("my_records.db"). Examining the resultant file may help you understand what pythonSoftIOC is doing automatically for you.

  3. locked and limited conversation to collaborators on Dec 13, 2021
  4. converted this issue into a discussion #72 on Dec 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions