Hi All,
it is rather an architectural/style question that I ran into working on
the device support for a message based serial/ethernet device (yes, it is
the LoCuM4).
Imagine there is a command that retrieves various status values binary
encoded in a string (bytes, shifted to printable characters...). I would
like to serve several PV's out of that. (It wouldn't make sense to put so
much information in just one record, mbbi, whatsoever)!
As always there are different ways to deal with that:
Worst case that I can think of is to have AsynDriver device support for
each record, so EACH time ONE of them is processed there would be I/O
transaction at the interface for retrieving the whole status string and
the tiny bit (literally!) of interest will be extracted.
My way so far is another: There is one AsynDriver-powered record
(stringin) which retrieves and holds the status string. That value is read
by a longin record via dbGetField() in a standard device support, which
extracts the information and distributes to all the other relevant records
via dbPutField(). Thus these other records don't need any device/record
support implementation themselves but are set remotely. Unfortunately this
complicates handling the alarm/invalid states of these records.
So the question is:
Would it be better to have already my AsynDriver-powered record, which
reads the status bytes, distributing the values to the different records
via dbPutField()?
Alternatively I like the idea of only one device support implementation
for several records which is flexible using the INP field as a
parameter...
Any suggestions?
What could be more 'stylish'?
Thanks in advance,
Jens