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  2009  2010  2011  <20122013  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  2009  2010  2011  <20122013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: RE: problem passing string to aSub record parameter
From: "Steiner, Mathias" <[email protected]>
To: Jim Chen <[email protected]>, "'Tim Mooney'" <[email protected]>
Cc: "[email protected]" <[email protected]>
Date: Fri, 28 Sep 2012 15:05:40 +0000
[..] is a name of the link or a real string? Or what is the correct format to pass a real string constant?

How about:

record(stringout, "TESTSTR")
{
  field(VAL,   "Test string")
}


and then:

field(INPA,"TESTSTR") 

Cheers  -Mathias

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Jim Chen
Sent: Friday, September 28, 2012 11:00 AM
To: 'Tim Mooney'
Cc: [email protected]
Subject: RE: problem passing string to aSub record parameter

Sorry Tim, that was my typo. It is pSub->a in my code.

Well, having been tracking down the files in the core: aSubRecord.c, getGbl.c and dbLexRoutines.c, I am wondering how can the dbLoadRecords or dbReadDatabase tell the "Test string" in 

	field(INPA,"Test string") 

is a name of the link or a real string? Or what is the correct format to pass a real string constant?

Jim

-----Original Message-----
From: Tim Mooney [mailto:[email protected]]
Sent: 28 September 2012 15:53
To: Jim Chen
Cc: [email protected]
Subject: Re: problem passing string to aSub record parameter

re...

----- Original Message -----
> From: "Jim Chen" <[email protected]>
> To: [email protected]
> Sent: Friday, September 28, 2012 8:49:23 AM
> Subject: problem passing string to aSub record parameter Can anybody 
> help please -- passing STRING to aSub record parameter field doesn’t 
> seem to work.
> 
> 
> 
> My aSub record
> 
> 
> 
> record(aSub,"TRANSMIT")
> 
> {
> 
> field(INAM,"myfunctionInit")
> 
> ……
> 
> field(INPA,"Test string")
> 
> field(FTA,"STRING")
> 
> field(NOA,"20")
> 
> ……
> 
> }
> 
> 
> 
> myfunctionInit(aSubRecord * pSub)
> 
> {
> 
> ……
> 
> char test[40];
> 
> strcpy(test, (char *)subr->a);

Shouldn't this be
  strcpy(test, (char *)pSub->a);

> 
> 
> printf("Text: %s\n", test);
> 
> ……
> 
> }
> 
> 
> 
> The printf statement doesn’ t print anything. When I check the length 
> of the ‘test’ variable, it is always 0.
> 
> 
> 
> Have I done wrong?
> 
> 
> 
> Thanks,
> 
> Jim

--
Tim Mooney ([email protected]) (630)252-5417 Software Services Group (www.aps.anl.gov) Advanced Photon Source, Argonne National Lab





References:
problem passing string to aSub record parameter Jim Chen
Re: problem passing string to aSub record parameter Tim Mooney
RE: problem passing string to aSub record parameter Jim Chen

Navigate by Date:
Prev: RE: problem passing string to aSub record parameter Jim Chen
Next: Re: problem passing string to aSub record parameter Andrew Johnson
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  <20122013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: RE: problem passing string to aSub record parameter Jim Chen
Next: Re: problem passing string to aSub record parameter Andrew Johnson
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  <20122013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 18 Nov 2013 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·