Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to update waveform data #24

Open
olliesilvester opened this issue Aug 3, 2023 · 3 comments
Open

Unable to update waveform data #24

olliesilvester opened this issue Aug 3, 2023 · 3 comments

Comments

@olliesilvester
Copy link

Using the IOC with a real panda, there is an error in _tables.py upon trying to update any of the waveform table PV's, eg PGEN1:TABLE:POSITION.
The IOC client gives the logging warning and error:
INFO:Sending table data for PGEN1:TABLE to PandA WARNING:Index 0 of record PGEN1:TABLE:POSITION is out of bounds. Traceback (most recent call last): File "/dls_sw/work/common/python/p45-ophyd-venv/lib/python3.9/site-packages/pandablocks_ioc/_tables.py", line 700, in _update_scalar scalar_val = waveform_data[index] IndexError: index 0 is out of bounds for axis 0 with size 0

It could be that the code currently doesn't allow for 0 waveforms, which is the initial setting.

To reproduce:

  • Locally run the ioc from /dls_sw/work/common/python/p45-ophyd-venv/lib/python3.9/site-packages/pandablocks_ioc and connect to a real panda
  • Use a branch of ophyd-epics-devices which can connect to the PandA (eg save_load_changing_all_values), as right now the main branch can't connect.
  • Write a simple test to try and update the value to one of these PV's. Eg:
async def test_set_panda_table():
    panda: PandA = PandA("IOC-PANDA-NAME")
    await panda.connect()
    array_data = np.array([1] * 100)
    await panda.pgen1.table.set(array_data)

caput also doesn't work, although no helpful error is outputted from this

@AlexanderWells-diamond
Copy link
Contributor

This is likely an issue with the max_length parameter coming back from PandA. The waveform record is initialized with length=field_info.max_length here. This means the waveform record should be being created empty, but with some maximum size and therefore should allow the later adding of data.

This can be checked by using PandA-Client to get all the info for the Field, and seeing what data appears in the FieldInfo structure.

@olliesilvester
Copy link
Author

olliesilvester commented Aug 3, 2023

The max_length parameters seem to come back as I'd expect:

< PGEN2.TABLE.MAX_LENGTH?
OK =262144

< SEQ1.TABLE.MAX_LENGTH?
OK =16384

@olliesilvester
Copy link
Author

olliesilvester commented Aug 8, 2023

The IndexError here is a red herring. The waveform data wasn't changing due to bluesky/ophyd#1145

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants