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  2012  2013  2014  2015  2016  <20172018  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  2012  2013  2014  2015  2016  <20172018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: Basic String Concatenation in EPICS
From: "Mooney, Tim M." <[email protected]>
To: "Sobhani, Bayan" <[email protected]>, "[email protected]" <[email protected]>
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 ([email protected]) (630)252-5417
Beamline Controls Group (www.aps.anl.gov)
Advanced Photon Source, Argonne National Lab


From: [email protected] <[email protected]> on behalf of Sobhani, Bayan <[email protected]>
Sent: Friday, October 6, 2017 12:11:48 PM
To: [email protected]
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  <20172018  2019  2020  2021  2022  2023  2024 
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  <20172018  2019  2020  2021  2022  2023  2024 
ANJ, 21 Dec 2017 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·