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

Issue with IOC startup (handling tables) #45

Open
dmgav opened this issue Sep 13, 2023 · 1 comment · May be fixed by #46
Open

Issue with IOC startup (handling tables) #45

dmgav opened this issue Sep 13, 2023 · 1 comment · May be fixed by #46

Comments

@dmgav
Copy link
Contributor

dmgav commented Sep 13, 2023

The IOC fails to start with the following error message:

initial_value=field_details.labels.index(initial_value),

Below is the traceback. I inserted some helpful print statements in the code, so the line numbers in _table.py are shifted by 3.

field_details=TableFieldDetails(subtype='enum', bit_low=16, bit_high=19, description='The trigger condition to start the phases ', labels=['Immediate', 'BITA=0', 'BITA=1', 'BITB=0', 'BITB=1', 'BITC=0', 'BITC=1', 'POSA>=POSITION', 'POSA<=POSITION', 'POSB>=POSITION', 'POSB<=POSITION', 'POSC>=POSITION', 'POSC<=POSITION'])
field_details.labels = ['Immediate', 'BITA=0', 'BITA=1', 'BITB=0', 'BITB=1', 'BITC=0', 'BITC=1', 'POSA>=POSITION', 'POSA<=POSITION', 'POSB>=POSITION', 'POSB<=POSITION', 'POSC>=POSITION', 'POSC<=POSITION']
type(labels) = <class 'list'>
ERROR:Exception while initializing softioc
Traceback (most recent call last):
  File "/nsls2/users/dgavrilov/repos/PandABlocks-ioc/src/pandablocks_ioc/ioc.py", line 145, in create_softioc
    ).result()
  File "/nsls2/users/dgavrilov/conda_envs/2023-2.1-py310-tiled-panda/lib/python3.10/concurrent/futures/_base.py", line 458, in result
    return self.__get_result()
  File "/nsls2/users/dgavrilov/conda_envs/2023-2.1-py310-tiled-panda/lib/python3.10/concurrent/futures/_base.py", line 403, in __get_result
    raise self._exception
  File "/nsls2/users/dgavrilov/repos/PandABlocks-ioc/src/pandablocks_ioc/ioc.py", line 99, in _create_softioc
    (all_records, all_values_dict, block_info_dict) = await create_records(
  File "/nsls2/users/dgavrilov/repos/PandABlocks-ioc/src/pandablocks_ioc/ioc.py", line 1818, in create_records
    records = record_factory.create_record(
  File "/nsls2/users/dgavrilov/repos/PandABlocks-ioc/src/pandablocks_ioc/ioc.py", line 1607, in create_record
    return self._make_table(record_name, field_info, list_vals)
  File "/nsls2/users/dgavrilov/repos/PandABlocks-ioc/src/pandablocks_ioc/ioc.py", line 1114, in _make_table
    table_updater = TableUpdater(
  File "/nsls2/users/dgavrilov/repos/PandABlocks-ioc/src/pandablocks_ioc/_tables.py", line 390, in __init__
    initial_value=field_details.labels.index(initial_value),
ValueError: 0 is not in list
@dmgav
Copy link
Contributor Author

dmgav commented Sep 13, 2023

The error happens while processing SEQ2 module, which has an empty table. The exception is raised for TRIGGER column of the table.

INFO:Description for SEQ2:TABLE:TRIGGER longer than EPICS limit of 40 characters. It will be truncated. Description: The trigger condition to start the phases 
field_name=TRIGGER
field_data={'REPEATS': array([], dtype=uint32), 'TRIGGER': [], 'POSITION': array([], dtype=int64), 'TIME1': array([], dtype=uint32), 'OUTA1': array([], dtype=uint32), 'OUTB1': array([], dtype=uint32), 'OUTC1': array([], dtype=uint32), 'OUTD1': array([], dtype=uint32), 'OUTE1': array([], dtype=uint32), 'OUTF1': array([], dtype=uint32), 'TIME2': array([], dtype=uint32), 'OUTA2': array([], dtype=uint32), 'OUTB2': array([], dtype=uint32), 'OUTC2': array([], dtype=uint32), 'OUTD2': array([], dtype=uint32), 'OUTE2': array([], dtype=uint32), 'OUTF2': array([], dtype=uint32)}
len(field_data[field_name])=0
field_details=TableFieldDetails(subtype='enum', bit_low=16, bit_high=19, description='The trigger condition to start the phases ', labels=['Immediate', 'BITA=0', 'BITA=1', 'BITB=0', 'BITB=1', 'BITC=0', 'BITC=1', 'POSA>=POSITION', 'POSA<=POSITION', 'POSB>=POSITION', 'POSB<=POSITION', 'POSC>=POSITION', 'POSC<=POSITION'])
field_details.labels = ['Immediate', 'BITA=0', 'BITA=1', 'BITB=0', 'BITB=1', 'BITC=0', 'BITC=1', 'POSA>=POSITION', 'POSA<=POSITION', 'POSB>=POSITION', 'POSB<=POSITION', 'POSC>=POSITION', 'POSC<=POSITION']
type(labels) = <class 'list'>
ERROR:Exception while initializing softioc

@dmgav dmgav linked a pull request Sep 14, 2023 that will close this issue
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

Successfully merging a pull request may close this issue.

1 participant