subArray record does not send monitors for NORD

Bug #1690169 reported by Ralph Lange
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
EPICS Base
Status tracked in 7.0
3.15
Fix Released
Undecided
Unassigned
3.16
Fix Released
Undecided
Unassigned
7.0
Fix Released
Undecided
Unassigned

Bug Description

Reported by yves.lussignol_AT_cea.fr:

I thought it was possible to monitor the NORD field of the subArray record as for the waveform record since 3-15, but it isn't. I saw in the tech-talk that a similar feature has been added in june 2011 to the NUSE field of the compress record. Could it be possible to add this feature to the subArray record in the next 3-15 release ?

Thank you in advance.

Revision history for this message
Ralph Lange (ralph-lange) wrote :

Attaching the patch that Yves sent.

Revision history for this message
Ralph Lange (ralph-lange) wrote :

I agree that this should go into 3.15.

Revision history for this message
mdavidsaver (mdavidsaver) wrote :

Looks ok to me.

Revision history for this message
Andrew Johnson (anj) wrote :

I'm not sure whether this is right, I'd need to experiment with various configurations to be sure. Yves' patch only handles puts to the record's VAL field, I would expect to also need a patch to the src/std/dev/devSASoft.c device support which also sets NORD without calling db_post_events().

However more fundamentally I wonder what it means to put an array into a subArray record? Should doing that cause the record to process and extract the indicated subset of that array, or is the value you're putting already meant to be the subarray?

Putting a value to an ai record's VAL field causes it to read its INP link if set, and I since the subArray.VAL field is PP I believe the same behavior should already be happening there, when INP is set. The question is what should happen when INP is not set (i.e prec->inp.type == CONSTANT in 3.15, slightly different in 3.16.1 now). The current 3.15 device support code does handle that case, it extracts NELM elements from the VAL field and updates NORD, but I don't remember whether the RSET::put_array_info() routine is called before or after the rset::process() routine, and that will have an effect on this alteration...

Revision history for this message
Andrew Johnson (anj) wrote :

I *think* I kept the same behavior in 3.16.1 that was happening in 3.15, but someone should probably check that too (warning, any patch to the devSASoft.c file is unlikely to merge up to 3.16 cleanly).

Revision history for this message
Ralph Lange (ralph-lange) wrote :

I agree that putting an array should read from the INP iff INP is set.

Yves' use case was writing a variable length array from an aSub output. (i.e. the subArray's INP not set)
He couldn't use a waveform record as target because the wf does not allow to change NELM at runtime.

    When you output an array from aSub into a waveform,
    NELM are always transfered and NORD will be equal to NELM.

    With subArray I don't know how many elements are transfered
    (probably MALM) but I can change its NELM to the useful size
    and NORD will be equal to this NELM.

Revision history for this message
Ralph Lange (ralph-lange) wrote :

For me, the strongest argument is that I think the array-type records should all act similar. (To follow the Principle of Least Astonishment.)
If the waveform record sends monitors on changed NORD, the subArray should do the same.

Andrew Johnson (anj)
Changed in epics-base:
status: New → Confirmed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.