Closed sandsbl closed 1 year ago
I thing, there was no discussion about this in the past.
Can you propose a pull request with this functionality?
Yes, I can start working on it.
@sandsbl Have you implemented this feature?
No, I haven't had a chance to, sorry. Moved to another project.
On Wed, Apr 15, 2020 at 5:51 PM PolyPik notifications@github.com wrote:
@sandsbl https://github.com/sandsbl Have you implemented this feature?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/j123b567/scpi-parser/issues/81#issuecomment-614298393, or unsubscribe https://github.com/notifications/unsubscribe-auth/AD6RJT7TRBDYHLGQPOAFPLTRMYT7BANCNFSM4CQYN7BQ .
Well you did a pretty good job of describing what needs to be done. I think I can implement the changes on my own.
Should be fixed by #114
@PolyPik , do you happen to have an example or test case that uses device specific registers? I'm trying to use the functionality, to flag that a digital input has changed level. I am investigating how to use the extension by trying to use it in my project. An example or reference project would be helpful.
I figured it out. I managed to build a set of instrument specific registers,
make them fan out to a bit of the OPERATION STATUS register, etc...
Took me a good week to fully make it happen :) - partly because I wanted a good integration with TinyUSB's TMCUSB with service requests.
documentation link.
As part of our SCPI instrument development, we have come upon a need to include "fan-out" registers for certain bits in QUEStionable and OPERation status registers as defined in section 9.4 of the SCPI-99 spec. I propose adding this as a feature-request for the scpi-parser library. I am willing to work on this feature, as we are in the most immediate need for it, but I would like to get some feedback on my thoughts on how to proceed. I am thinking to take the following steps to implement this feature:
*Add the member `scpi_fanout_reg_t fanout_registers;
to
_scpi_tcontext structure** This would be a pointer to an array of device-specific fanout registers that would need to be defined in
scpi_context.c. Each fanout register could be defined in
types.h` asThis specifies the register value
val
, its standard parent registerparent_reg
(one of OPER or QUES), and the summary bit to which this fanout is logically summedparent_bit
. Since the standard specifies the potential for multiple layers of nesting fanout registers, the last two members would handle this case. Ifis_nested
isTRUE
, then the fanout register at indexparent_fanout_reg
is updated as a summary bit.SCPI_RegXXX
functions inIEEE488.c
The following functions would need to have their "fanout" analogs added to handle
scpi_fanout_reg_t
registers:SCPI_RegSet
->SCPI_RegSetFanout
SCPI_RegSetBits
->SCPI_RegSetFanoutBits
SCPI_RegClearBits
->SCPI_RegClearFanoutBits
SCPI_RegGetFanout
->SCPI_RegGetFanout
regUpdate
->regUpdateFromFanout
Additionally, there is a need for a new function
SCPI_RegCheckBits
that would check if a particular register bit from OPER or QUES is a summary bit. This would presumably be used e.g. when a *CLS command is issued or when a summary bit is read in order to clear its associated fanout registers.SCPI_CoreCLS
inIEEE488.c
Clear fanout registers.
SCPI_StatusPreset
inminimal.c
Handle fanout registers.
Please advise with suggestions or issues I may have forgot.