EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  <20082009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  <20082009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: USE of CA lib: problem using ca_array_put_callback with strings
From: Andrew Johnson <[email protected]>
To: [email protected]
Date: Fri, 14 Nov 2008 10:04:49 -0600
Hi Christophe,

On Friday 14 November 2008 08:01:43 haquin wrote:
> I have some problems with the Channel Access library use,
> more precisely the use of /*ca_array_put_callback*/ with STRINGS !
>
> We are using a peace of exemple C code, picked-up at :
> *http://lansce.lanl.gov/EPICSdata/ca/client*, that uses this CA API.
> We have some problems with the ca_array_put_callback when we want to
> write strings.

That URL doesn't work any more, can you post at least an extract of the code 
that you're using, showing both the call to ca_array_put_callback() and your 
callback routine.

> We use this code to put a string in the DESC field of a record,
> The problem is that only the first caracter of the string is written to
> the PV,
> The callback is called, everything seem to bee correct except that there
> is only the first caracter in the destination.

I'm not able to recreate the problem on R3.14.10, so it may be a bug in the 
code you're using (I'm not suggesting that you need to upgrade though, since 
I'm not aware of any bug fixes in that area of the code).  The caput program 
that comes with base has a -c option that means 'use put callback' and can 
deal with arrays.  Here's how I tested it:

tux% bin/linux-x86_64/caput -c anjHost:aiExample.DESC "New string"
Old : anjHost:aiExample.DESC         Analog input
New : anjHost:aiExample.DESC         New string
tux% bin/linux-x86_64/caput -c -s -a anjHost:aiExample.DESC 1 "Array string"
Old : anjHost:aiExample.DESC         New string
New : anjHost:aiExample.DESC         Array string

Note that the DESC field will only accept a 1-item array; if you try to send 
more it will fail, demonstrating that caput is doing an array put:

tux% bin/linux-x86_64/caput -c -s -a anjHost:aiExample.DESC 2 String array
Old : anjHost:aiExample.DESC         Array string
Write callback operation timed out
New : anjHost:aiExample.DESC         Array string

- Andrew
-- 
Talk is cheap. Show me the code. -- Linus Torvalds

Replies:
Re: USE of CA lib: problem using ca_array_put_callback with strings haquin
Re: USE of CA lib: problem using ca_array_put_callback with strings haquin
References:
USE of CA lib: problem using ca_array_put_callback with strings haquin

Navigate by Date:
Prev: USE of CA lib: problem using ca_array_put_callback with strings haquin
Next: Re: USE of CA lib: problem using ca_array_put_callback with strings haquin
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  <20082009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: USE of CA lib: problem using ca_array_put_callback with strings haquin
Next: Re: USE of CA lib: problem using ca_array_put_callback with strings haquin
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  <20082009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 02 Sep 2010 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·