Skip to content

Waveform records ignore NELM keyword if initial_value is set #37

@AlexanderWells-diamond

Description

@AlexanderWells-diamond

If you specify both an initial_value=... and NELM=... keywords when creating a WaveformOut record, the NELM keyword is ignored and the waveform is created with a maximum length equal to the length of the data.

I think the offending line is L169 of builder.py, which seems to override the passed in NELM without checking if it is set:
fields['NELM'] = length

There is a workaround: instead of initial_value and NELM, use something like this (assuming data is a numpy array)

length=required_length,
datatype=data.dtype,

And later do myrecord.set(data)

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions