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  2008  <20092010  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  2008  <20092010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: can't output strings array with gensub
From: haquin <[email protected]>
To: Eric Norum <[email protected]>, Matthieu Bec <[email protected]>
Cc: tech-talk Techtalk <[email protected]>
Date: Tue, 24 Feb 2009 16:00:59 +0100
Thank you Matthieu, for your solution, I've just tried it.


Eric,
In my genSub, I will analyse the bits of a Defect word, and translate each bit field in a string, then I output an array where the strings are available for operator display.

Implementation with several mbbi records cannot fulfill all my needs, so I do the analysis with genSub.

All this to explain I am not concatenating several mesages so your proposal is not adequate, thanks anyway.

However, don't hesitate if you have any other suggestion of implementation.

Best Regards.

 Eric Norum a écrit :
Are you trying to just send and print the concatenated error message strings?
Perhaps something like this is adequate?
    FTVN: CHAR
    NOVN: 120



    int nleft = precord->novn;
    char *np = (char *)precord-:>valn;
    int n;

    n = epicsSnprintf(np, nleft, "Defect string 1. ");
    nleft -= n;
    np += n;
    .
    .
    n = epicsSnprintf(np, nleft, "Defect string 2.  ");
    nleft -= n;
    np += n;
    .
    .
    .
haquin wrote:
Hi all,
I have configured a gensub record to output a string array but this doesn't work.
I set the following genSub fields:
FTVN:STRING
NOVN:12
in my process function I do the following:
 sprintf ((char*)precord->valn, "Defect String 1");
 sprintf ( (char*)(((char**)(precord->valn))+1), "Defect String 2");
When I execute the IOC, the output is the following:
epics> dbgf IOCASTE-TST:ProcessDynamicModbusTable.VALN
DBR_STRING:          DefeDefect String 2
the second string has overwritten the first one.
It seems that there only one string
thanks in advance for your help.

begin:vcard
fn:Christophe Haquin
n:Haquin;Christophe
email;internet:[email protected]
tel;work:02 31 45 46 61
x-mozilla-html:FALSE
version:2.1
end:vcard


References:
can't output strings array with gensub haquin
Re: can't output strings array with gensub Matthieu Bec
Re: can't output strings array with gensub Eric Norum

Navigate by Date:
Prev: Re: can't output strings array with gensub Eric Norum
Next: Re: Dynamic Listing of PVs Andrew Johnson
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  <20092010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Re: can't output strings array with gensub Eric Norum
Next: use and utility of permissive record haquin
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  <20092010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 31 Jan 2014 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·