-
Notifications
You must be signed in to change notification settings - Fork 90
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
Add PVA RPC Action #2906
base: master
Are you sure you want to change the base?
Add PVA RPC Action #2906
Conversation
Well, happy to see that you can implement that without any changes to the PVA lib, so we do have sufficient RCP support in there.
The result of the request is not used, even though we spend up to 20 seconds getting it?! |
It seems like a good fit to me, but I must admit I'm quite new to Phoebus.
I was thinking of adding a callback of some sort, but just a writeback seems good to me. I'm working on this feature on my local checkout at the moment. Do you think a callback would make more sense?
I assume one would store it in a In any case, this PR is still a draft but if it ends up not getting merged we will most likely still use it in our local fork. |
I see how you store the result in a (local) PV. In the commits, the I'm still not convinced that this justifies a general widget action update, since it only applies to one of the supported PV types, and the use cases seem to specific. |
Ugh looks like about 10% of files have windows line endings checked in, I wasn't aware of that. Is there some policy on this? Should I continue to use windows line endings, should I add a single commit to change the line endings and a separate commit with changes, should I do a secret third thing? |
Our current use-case is for rapid control of PLC code. Next to variables, we also export methods. Quickly being able to invoke these methods without much scripting, and optionally see what is returns. However, the most common case is invoking a single action on a PLC. Though this can be done by a script, this is simpler. We may extend it to invoke methods in our application SoftIoC in the future. |
Can't that be handled by simply writing to the PLC? So far, PLC integration tended to use channel access, where all you can do is read or write, so writing was used for this. Which PLC has PVA support at this time? |
We have our own PVA RPC <-> ADS gateway. Next to that we configured coselab's adsDriver to support PVA for variables. Beckhoff PLCs support RPC calls. |
I would encourage more use of RPC, as I think it is a better way to control devices rather than the "fire-and-forget" method of modifying the setpoint. For example if the request to the device causes an internal error it can be reported back to the user. |
String argName = MacroHandler.replace(widget.getMacrosOrProperties(), a.getKey()); | ||
|
||
PVAData param; | ||
// TODO: is there a generic way to convert a VType to PVAData? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a good way to do this? I wanted to add a constructor to (e.g.) PVAData but that would create a cross-cutting dependency, so I didn't want to just blindly go into that.
So far, no phoebus app directly talks to CA, PVA, MQTT, local, simulated, formula PVs. I don't like how this PR circumvents that abstraction layer. The WidgetRuntime which usually deals with the PV/VType now directly creates, uses and then disposes a PVA PV. A "disconnected" state is only detected when you press the button, whereas we otherwise have all PVs connected and see what's disconnected before we push a button or enter a value. Plus you have the expected question of how to map arbitrary PVA data structures to VTypes. To properly support RPC, that should be added to the PV layer.
For PVA and MQTT you could implement an actual RPC call. |
WIP.
TODO:
unclear how this even should be doneactually looks likeloc://
is good for this)