-
Notifications
You must be signed in to change notification settings - Fork 82
Description
Right now, if we want to set value limits in records (e.g. DRVHand DRVL) based on information queried from the a device, it's necessary to create auxiliary parameters, then create records for those parameters which set the relevant fields for the original record. That has to be repeated for every record we wish to have limits for.
If the driver has that information, it could set it during initialization, and (possibly) change it during runtime. For initialization, it would be necessary to add a getLimits function to (at least) asynInt32, asynUInt32Digital, asynInt64 and asynFloat64 interfaces, and use them in the init* functions for relevant records (e.g. longout for asynInt32; supporting ao would require converting the integer limits, which might be error prone).
Changing the limits during runtime might be more complicated, as it would require changes to paramVal to store those limits (and developers would have to guarantee that the values returned by getLimits are also stored in the parameter library), or some new kind of callback routine. That would be a separate design step, and I would welcome help.
This is a suggestion, which I believe would simplify driver development and improve the interface to those drivers; it makes it easier to clamp values right at the record layer, instead of having to return errors to out-of-bounds put operations.
Is there interest in something like that, if implemented in an adequate manner? I would like to gather opinions before trying to implement it.