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

info() to mark waveform w/ FTVL=CHAR as "long string" #17

Open
mdavidsaver opened this issue May 8, 2018 · 6 comments
Open

info() to mark waveform w/ FTVL=CHAR as "long string" #17

mdavidsaver opened this issue May 8, 2018 · 6 comments
Assignees

Comments

@mdavidsaver
Copy link
Member

Need a way to mark to a waveform of characters as being a "string".

@mdavidsaver mdavidsaver self-assigned this May 8, 2018
@mdavidsaver
Copy link
Member Author

Also, a flag info() or server side filter to treat DBF_LONG as DBF_ULONG as existing drivers have been storing unsigned as signed (cf. longinRecord).

@mdavidsaver
Copy link
Member Author

Should also handle DBF_*LINK automatically as long strings.

@anjohnson
Copy link
Member

Just spotted "waveform of characters" — please don't use the word "waveform" to mean "array"…

Good points, but please discuss your proposed solution(s) before completing any implementation. I'm not looking to bike-shed this, but I think we should get agreement between the core dev's about how to handle this extra metadata.

@mdavidsaver
Copy link
Member Author

I'm not looking to bike-shed this

Now don't disappoint me Andrew! I expect you to bike-shed this ... once.

As a starting point, how about:

info(Q:format, "String")

Where Q:format would have to be one of the defined enumerations of the "display.format" field. Which I realize haven't been recorded in #19.

@coretl
Copy link
Contributor

coretl commented Mar 15, 2023

5 years later I'm in need of this. I tried Q:form but it doesn't seem to change anything apart from display.form:

record(waveform, "STRING:PLEASE")
{
    field(NELM, 6500)
    field(FTVL, "CHAR")
    field(INP, {const:"A very long label, longer than 40 characters, that needs a waveform"})
    info(Q:form, "String")
}
$ caget -S STRING:PLEASE
STRING:PLEASE A very long label, longer than 40 characters, that needs a waveform
$ pvget -v STRING:PLEASE
STRING:PLEASE epics:nt/NTScalarArray:1.0 
    byte[] value [65,32,118,101,114,121,32,108,111,110,103,32,108,97,98,101,108,44,32,108,111,110,103,101,114,32,116,104,97,110,32,52,48,32,99,104,97,114,97,99,116,101,114,115,44,32,116,104,97,116,32,110,101,101,100,115,32,97,32,119,97,118,101,102,111,114,109,0]
    alarm_t alarm INVALID DRIVER UDF 
        int severity 3
        int status 2
        string message UDF
    time_t timeStamp <undefined>              
        long secondsPastEpoch 631152000
        int nanoseconds 0
        int userTag 0
    structure display
        double limitLow 0
        double limitHigh 0
        string description 
        string units 
        int precision 0
        enum_t form (1) String
            int index 1
            string[] choices [Default, String, Binary, Decimal, Hex, Exponential, Engineering]
    control_t control
        double limitLow 0
        double limitHigh 0
        double minStep 0
    valueAlarm_t valueAlarm
        boolean active false
        double lowAlarmLimit nan
        double lowWarningLimit nan
        double highWarningLimit nan
        double highAlarmLimit nan
        int lowAlarmSeverity 0
        int lowWarningSeverity 0
        int highWarningSeverity 0
        int highAlarmSeverity 0
        byte hysteresis 0

Is there a way to make this work?

@coretl
Copy link
Contributor

coretl commented Mar 15, 2023

An lsi record very nearly does what I want...

record(lsi, "STRING:PLEASE")
{
    field(SIZV, 6500)
    field(INP, {const:"A very long label, longer than 40 characters, that needs a waveform"})
}
$ caget -S STRING:PLEASE.VAL$
STRING:PLEASE.VAL$ A very long label, longer than 40 characters, that needs a waveform
$ pvget -v STRING:PLEASE
STRING:PLEASE epics:nt/NTScalar:1.0 
    string value "A very long label, longer than 40 chara"
    alarm_t alarm INVALID DRIVER UDF 
        int severity 3
        int status 2
        string message UDF
    time_t timeStamp <undefined>              
        long secondsPastEpoch 631152000
        int nanoseconds 0
        int userTag 0
    structure display
        double limitLow 0
        double limitHigh 0
        string description 
        string units 
        int precision 0
        enum_t form (0) Default
            int index 0
            string[] choices [Default, String, Binary, Decimal, Hex, Exponential, Engineering]
    control_t control
        double limitLow 0
        double limitHigh 0
        double minStep 0

I may have missed something though, I've never used an lsi record before...

@mdavidsaver mdavidsaver mentioned this issue Mar 27, 2023
21 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants