Skip to content
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

pvput requires value field or else it fails #116

Closed
mrkraimer opened this issue Jul 18, 2018 · 2 comments
Closed

pvput requires value field or else it fails #116

mrkraimer opened this issue Jul 18, 2018 · 2 comments
Labels

Comments

@mrkraimer
Copy link
Contributor

The following does not work

mrk> pvput -r timeStamp.userTag PVRdouble 50
Old : 
structure 
    structure timeStamp
        int userTag 0


Error: Structure has no .value
New : 
structure 
    structure timeStamp
        int userTag 0

The following does work

mrk> pwd
/home/epicsv4/masterCPP/exampleCPP/exampleClient
mrk> bin/linux-x86_64/put -r "timeStamp.userTag" PVRdouble
provider pva channelName PVRdouble request timeStamp.userTag debug false
_____put starting__
enter one of: exit put get
channelPutConnect PVRdouble status Status [type=OK]
put
enter value or values to put
50
exit
mrk> pvget -r "timeStamp.userTag" PVRdouble
PVRdouble
structure 
    structure timeStamp
        int userTag 50

@mdavidsaver
Copy link
Member

mdavidsaver commented Jul 18, 2018

mrk> pvput -r timeStamp.userTag PVRdouble 50

Try:

pvput -r timeStamp.userTag PVRdouble timeStamp.userTag=50

I found the previous (argument stack) behavior of pvput to be extremely non-intuitive. eg. It requires that a user anticipate whether a PV is a scalar or or an array. An incorrect assumption can fail in unexpected ways. Of course it also depends on specific handling of pvRequest which I don't like.

The new behavior requires the user to be explicit in what is intended by naming <field>=<value> with the exception of a shorthand notation which only applies to .value (which I see as the 90% case).

The updated help lays this out as:

$ pvput -h
Usage: pvput [options] <PV name> <value>
       pvput [options] <PV name> <size/ignored> <value> [<value> ...]
       pvput [options] <PV name> <field>=<value> ...
       pvput [options] <PV name> <json_array>
       pvput [options] <PV name> <json_map>
...
Examples:

  pvput double01 1.234       # shorthand
  pvput double01 value=1.234

  pvput arr:pv X 1.0 2.0  # shorthand  (X is arbitrary and ignored)
  pvput arr:pv "[1.0, 2.0]"            # shorthand
  pvput arr:pv value="[1.0, 2.0]"

@mdavidsaver
Copy link
Member

the exception of a shorthand notation which only applies to .value

The shorthand is intended to mimic caput.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants