Experimental Physics and Industrial Control System
|
The end-goal is to give clients control of services from a window using Phoebus in new projects. There shouldn't be any race conditions from multiple clients as service interaction will come from either the system running Monit or interaction with the PVAServer that handles the transactions.
RPC (learning about it with EPICS/Phoebus now) may be a better use case for this while pvAccess can provide the current states. This will also simplify the pv structure.
I'll keep digging.
Thanks Michael, Will
On 4/2/19 8:23 PM, William Cork via Tech-talk wrote:
> Hi All,
>
> I’m working on a softIOC that will make calls to a Monit daemon to restart and monitor services under Monit.
>
> Right now, I have the following pv structure (a wip):
>
> |test:Monit:localhost structure string host http://localhost:2812 int poll 120 structure[] services structure string name testService boolean monitored true int state 0 string type SERVICE epics:nt/NTEnum:1.0 action enum_t value int index 0 string[] choices ["none", "enable", "disable", "start", "stop", "restart"] |
>
> Is it possible to change an element in the nested services list with pvput, or are the immutable?
> |pvput test:Monit:localhost services='...'| may be the wrong syntax?
> More precisely, can I change services[index of service I care about].action = "" of the action enums.
>
> Architecturally speaking, is it more ideal to have a bookkeeping PVArray that lists the provided services and individual PVs for each service?
Are you thinking to control this with a existing client application?
eg. an OPI client like cs-studio? I find that questions like this
are best approached by think from the prospective of a client.
What will a client want to do? What steps are involved?
Are there any issues of atomicity (eg. racing with other
clients). What configuration will a client need?
Now for the part for which I have a clear answer.
> pvput test:Monit:localhost services='...'
For the present the 'field=' syntax is limited to scalars and arrays of scalars.
It is possible to send an array of structures w/ pvput provided you're
building against Base >=3.15 (which includes a JSON parser). The syntax
is awkward though:
> $ pvput -h 2>&1|grep JSON
> JSON support is present
> Field values may be given with JSON syntax.
An empty array:
> pvput test:Monit:localhost '{"services":[]}'
One element with all default values.
> pvput test:Monit:localhost '{"services":[{}]}'
One element with one field having a non-default value.
> pvput test:Monit:localhost '{"services":[{"state":42}]}'
- References:
- Nested PVStructureArray With pvput William Cork via Tech-talk
- Re: Nested PVStructureArray With pvput Michael Davidsaver via Tech-talk
- Navigate by Date:
- Prev:
Re: Nested PVStructureArray With pvput Michael Davidsaver via Tech-talk
- Next:
RE: ADpython issues with openCV sandeep-kumar.malu--- via Tech-talk
- Index:
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
<2019>
2020
2021
2022
2023
2024
- Navigate by Thread:
- Prev:
Re: Nested PVStructureArray With pvput Michael Davidsaver via Tech-talk
- Next:
firewalld configuration for EPICS? Dirk Zimoch via Tech-talk
- Index:
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
<2019>
2020
2021
2022
2023
2024
|
ANJ, 03 Apr 2019 |
·
Home
·
News
·
About
·
Base
·
Modules
·
Extensions
·
Distributions
·
Download
·
·
Search
·
EPICS V4
·
IRMIS
·
Talk
·
Bugs
·
Documents
·
Links
·
Licensing
·
|