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 2025 | 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 2025 |
<== Date ==> | <== Thread ==> |
---|
Subject: | Re: can't output strings array with gensub |
From: | Matthieu Bec <[email protected]> |
To: | haquin <[email protected]> |
Cc: | [email protected] |
Date: | Tue, 24 Feb 2009 08:44:03 -0300 |
each string's offset by MAX_STRING_SIZE, try the following for (i=o;i<precord->novn,i++)snprintf ((char*)precord->valn+i*MAX_STRING_SIZE,MAX_STRING_SIZE, "Defect String %d",i );
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.
-- Matthieu Bec Gemini Observatory Tel: +56 51 205785 c/o AURA, Casilla 603 Fax: +56 51 205650 La Serena, Chile