EPICS Home

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: Basic String Concatenation in EPICS
From: "Sobhani, Bayan" <[email protected]>
To: "[email protected]" <[email protected]>
Date: Fri, 6 Oct 2017 17:11:48 +0000

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


Replies:
Re: Basic String Concatenation in EPICS Mooney, Tim M.

Navigate by Date:
Prev: Re: Asyn GPIB proto file exception @writetimeout Zimoch Dirk (PSI)
Next: Re: Basic String Concatenation in EPICS Mooney, Tim M.
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: Re: Writing PVs from an amalgamated structure Ralph Lange
Next: Re: Basic String Concatenation in EPICS Mooney, Tim M.
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