When using a WaveformOut record and doing .set() and .get(), the behaviour is not as expected when the initial_value is an empty numpy array:
# 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
wo = builder.WaveformOut("TEST", initial_value=numpy.array([]))
# Boilerplate get the IOC started
builder.LoadDatabase()
softioc.iocInit(dispatcher)
print(wo.get())
wo.set(numpy.array([10]))
print(wo.get())
# Finally leave the IOC running with an interactive shell.
softioc.interactive_ioc(globals())
This program prints:
...
iocRun: All initialization complete
[]
[]
If you change the initial_value to numpy.array([1]) then the program prints out the expected results:
...
iocRun: All initialization complete
[1]
[10]
Apologies if this is a duplicate of an existing issue, but it certainly is a novel symptom.
When using a
WaveformOutrecord and doing.set()and.get(), the behaviour is not as expected when theinitial_valueis an empty numpy array:This program prints:
If you change the
initial_valuetonumpy.array([1])then the program prints out the expected results:Apologies if this is a duplicate of an existing issue, but it certainly is a novel symptom.