Experimental Physics and Industrial Control System
Hi Andrew,
We've been trying to reduce network bandwidth on
CA image transfers by using ROI to reduce the required
data, and just noticed that the default for the caget
command line tool always fetches the full array, even
if NORD is less than NELM.
This happens because caget currently defaults to synchronous
get, and only the -c async option supports dynamic array sizing.
As async vs sync CA is a subtle distinction that doesn't matter for
most of our users, I've added an option to our caget to request
synchronous get and changed the default to async.
I think this could be useful for the broader community,
so here's a patch that does this.
Regards,
- Bruce
--
Bruce Hill
Member Technical Staff
SLAC National Accelerator Lab
2575 Sand Hill Road M/S 10
Menlo Park, CA 94025
Index: src/catools/caget.c
===================================================================
--- src/catools/caget.c (revision 15563)
+++ src/catools/caget.c (revision 15565)
@@ -57,7 +57,8 @@
" -h: Help: Print this message\n"
"Channel Access options:\n"
" -w <sec>: Wait time, specifies CA timeout, default is %f second(s)\n"
- " -c: Asynchronous get (use ca_get_callback and wait for completion)\n"
+ " -c: Asynchronous get (default, uses ca_array_get_callback and waits for completion)\n"
+ " -G: Synchronous get (use ca_array_get, no dynamic array sizing)\n"
" -p <prio>: CA priority (0-%u, default 0=lowest)\n"
"Format options:\n"
" Default output format is \"name value\"\n"
@@ -376,7 +377,7 @@
int n;
int result; /* CA result */
OutputT format = plain; /* User specified format */
- RequestT request = get; /* User specified request type */
+ RequestT request = callback;/* User specified request type */
IntFormatT outType; /* Output type */
int count = 0; /* 0 = not specified by -# option */
@@ -389,7 +390,7 @@
LINE_BUFFER(stdout); /* Configure stdout buffering */
- while ((opt = getopt(argc, argv, ":taicnhsSe:f:g:l:#:d:0:w:p:F:")) != -1) {
+ while ((opt = getopt(argc, argv, ":taiGcnhsSe:f:g:l:#:d:0:w:p:F:")) != -1) {
switch (opt) {
case 'h': /* Print usage */
usage();
@@ -400,6 +401,9 @@
case 'a': /* Wide output mode */
complainIfNotPlainAndSet(&format, all);
break;
+ case 'G': /* Synchronous mode */
+ request = get;
+ break;
case 'c': /* Callback mode */
request = callback;
break;
- Replies:
- Re: caget.c patch for dynamic array sizing Andrew Johnson
- Navigate by Date:
- Prev:
Re: Help with MEDM. Diego Henrique Dorta
- Next:
App build Error : menu not found Sud Roy
- 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: Help with MEDM. Diego Henrique Dorta
- Next:
Re: caget.c patch for dynamic array sizing Andrew Johnson
- 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