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  2012  2013  2014  2015  2016  <2017 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
<== Date ==> <== Thread ==>

Subject: Re: Basic String Concatenation in EPICS
From: "Mooney, Tim M." <mooney@aps.anl.gov>
To: "Sobhani, Bayan" <bsobhani@bnl.gov>, "tech-talk@aps.anl.gov" <tech-talk@aps.anl.gov>
Date: Fri, 6 Oct 2017 17:22:41 +0000

Hi Alex,


You should use the AA and BB fields for the string inputs.  Try this:


record (scalcout, "$(Sys)$(Dev)Result")

{

    field (DESC, "Open Loop Steps")

    field(SCAN, "1 second")

    field(INAA, "$(Sys)$(Dev)MVOL")

    field(INBB, "$(Sys)$(Dev)OLFQ")

    field(CALC, "AA+BB")

}


Tim Mooney (mooney@aps.anl.gov) (630)252-5417
Beamline Controls Group (www.aps.anl.gov)
Advanced Photon Source, Argonne National Lab


From: tech-talk-bounces@aps.anl.gov <tech-talk-bounces@aps.anl.gov> on behalf of Sobhani, Bayan <bsobhani@bnl.gov>
Sent: Friday, October 6, 2017 12:11:48 PM
To: tech-talk@aps.anl.gov
Subject: Basic String Concatenation in EPICS
 

Is there a way to concatenate two strings in EPICS?

 

Googling “concatenate strings epics” brings up sCalcout. I tried using sCalcout, but it insists on converting the inputs to floating point values and this causes some problems:

 

record (stringin, "$(Sys)$(Dev)OLFQ")

{

    field (DESC, "Open Loop Frequency")

    field (DTYP, "Soft Channel")

    field(SCAN, "Passive")

}

 

record (stringin, "$(Sys)$(Dev)MVOL")

{

    field (DESC, "Open Loop Steps")

    field(SCAN, "Passive")

}

 

record (scalcout, "$(Sys)$(Dev)Result")

{

    field (DESC, "Open Loop Steps")

    field(SCAN, "1 second")

    field(INPA, "$(Sys)$(Dev)MVOL")

    field(INPB, "$(Sys)$(Dev)OLFQ")

    field(CALC, "STR(A)+STR(B)")

}

 

 

If I set $(Sys)$(Dev)OLFQ to 1, and $(Sys)$(Dev)MVOL to 2, the result I get in SVAL is “1.00002.0000”. Is there any way to get just “12”? If I do it without the STR around A and B, it numerically adds A and B and I get “3.0000” for SVAl. Is it not possible to just concatenate two string PVs in epics?

 

Alex


References:
Basic String Concatenation in EPICS Sobhani, Bayan

Navigate by Date:
Prev: Basic String Concatenation in EPICS Sobhani, Bayan
Next: Re: init function in device support Thomas, Patrick
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
Navigate by Thread:
Prev: Basic String Concatenation in EPICS Sobhani, Bayan
Next: Opportunities at Australian Synchrotron Paul Martin
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
ANJ, 09 Oct 2017 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·