Skip to content

PINI flag is not set on In records when .set() is used #67

@AlexanderWells-diamond

Description

@AlexanderWells-diamond

In builder.py's _in_record function we see this code:

if 'initial_value' in fields:
        fields.setdefault('PINI', 'YES')

There is no equivalent code for when .set() is called. This means that In records do not process on startup correctly such that caget sees the value. For example run the following IOC in a terminal:

# Import the basic framework components.
from softioc import softioc, builder, asyncio_dispatcher
import numpy
# Create an asyncio dispatcher, the event loop is now running
dispatcher = asyncio_dispatcher.AsyncioDispatcher()

# Set the record prefix
builder.SetDeviceName("PREFIX")

# Create some records
li = builder.longIn("TEST")

li.set(10)

# Boilerplate get the IOC started
builder.LoadDatabase()
softioc.iocInit(dispatcher)


# Finally leave the IOC running with an interactive shell.
softioc.interactive_ioc(globals())

And from another do caget:

[...]$ caget PREFIX:TEST
PREFIX:TEST                    0

And we see that the .set() has not taken effect.

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