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 | 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 |
<== Date ==> | <== Thread ==> |
---|
Subject: | Splitting a string in a protocol file |
From: | "Wang, Andrew via Tech-talk" <tech-talk at aps.anl.gov> |
To: | "tech-talk at aps.anl.gov" <tech-talk at aps.anl.gov> |
Date: | Thu, 17 Dec 2020 19:47:12 +0000 |
Hi, I’m relatively new to EPICS and I have been tasked with writing drivers for a Keysight oscilloscope. One of the commands that I need to set up is the following: :CHANnel<N>:SCALe This command requires a channel number and a value. So if I wanted to set the vertical scale of Channel 2 to 50 V, I would do :CHANnel2:SCALe 50 I would like to work on both my protocol file and database file, but I am not sure how to go about it. This is what I currently have. record(aao, "set_vert_scale") { field(DESC, "Set vertical scale for a channel") field(DTYP, "stream") field(FTVL, "STRING") field(OUT, "@keysightOsc.proto setVertScale $(PORT)") } setVertScale { separator = “,” out "%s:SCALe "; } My goal is for the user to enter a command such as caput set_vert_scale CHAN1,5 so that the string can be split in a manner such that CHAN1 and 5 can be concatenated to the beginning and end of :SCALe. Any thoughts on how to do so? Thanks, Andy |