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

Allow int64 datatype #160

Open
evalott100 opened this issue May 7, 2024 · 2 comments
Open

Allow int64 datatype #160

evalott100 opened this issue May 7, 2024 · 2 comments
Assignees

Comments

@evalott100
Copy link

evalott100 commented May 7, 2024

In pandablocks, SEQ:REPEATS is a uint32, but since int64 isn't an option on softioc, we set it to an analogue out with a precision of 0. This means in ophyd async we had to allow for an epics float to be regarded as an int in this special case.

bluesky/ophyd-async#276 (comment)

I've decided that this is probably not where the fix should be, ophyd should trust the epics datatype. With this in mind, we should add functions for int64 in/out in builder.py for use in pandablocks-ioc. https://epics.anl.gov/base/R7-0/6-docs/int64outRecord.html

@AlexanderWells-diamond
Copy link
Collaborator

This is effectively asking for int64 support via the new EPICS 7 64bit record types - see issue #118 for some others we could also add while we're there

@evalott100
Copy link
Author

Did some debugging to narrow down exactly where our P4P error is happening:
We're expecting a different type on the value field.

initial_values[pv].type()


# returns
Type([
    ('value', 'd'),   # HERE we should have ('value', 'I') or ('value', 'l')
    ('alarm', (
        'S', 
        'alarm_t', 
        [
            ('severity', 'i'), 
            ('status', 'i'), 
            ('message', 's')
        ]
    )), 
    ('timeStamp', (
        'S', 
        'time_t', 
        [
            ('secondsPastEpoch', 'l'), 
            ('nanoseconds', 'i'), 
            ('userTag', 'i')
        ]
    )), 
    ('display', (
        'S', 
        'structure', 
        [
            ('limitLow', 'd'), 
            ('limitHigh', 'd'), 
            ('description', 's'), 
            ('units', 's'), 
            ('precision', 'i'), 
            ('form', (
                'S', 
                'enum_t', 
                [
                    ('index', 'i'), 
                    ('choices', 'as')
                ]
            ))
        ]
    )), 
    ('control', (
        'S', 
        'structure', 
        [
            ('limitLow', 'd'), 
            ('limitHigh', 'd'), 
            ('minStep', 'd')
        ]
    )), 
    ('valueAlarm', (
        'S', 
        'structure', 
        [
            ('active', '?'), 
            ('lowAlarmLimit', 'd'), 
            ('lowWarningLimit', 'd'), 
            ('highWarningLimit', 'd'), 
            ('highAlarmLimit', 'd'), 
            ('lowAlarmSeverity', 'i'), 
            ('lowWarningSeverity', 'i'), 
            ('highWarningSeverity', 'i'), 
            ('highAlarmSeverity', 'i'), 
            ('hysteresis', 'd')
        ]
    ))
], id="epics:nt/NTScalar:1.0")

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