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: | Re: Combing Two State Sets into One |
From: | Matthieu Bec <[email protected]> |
To: | [email protected] |
Cc: | [email protected] |
Date: | Thu, 22 Sep 2011 09:07:48 -0700 |
Hello Bradley You could make the channel name an argument to your program. This should work: /* Sample Program */ program sncExample("PV=xxx") option +r; /* reentrant */ float pv; assign pv to "{PV}"; ss ss { state one { pv = 1; pvPut(pv); } state two state two { pv = 2; pvPut(pv); } state one } in your startup: seq sncExample, "T=magnet1" seq sncExample, "T=magnet2" Regards, Matthieu On 9/22/11 8:53 AM, Bradley Pietrzak wrote:
Hello,The state notation language program shown below runs successfully. "magnet1" and "magnet2" are nothing more than simple analog inputs. Clearly, state sets one and two are identical, except for the process variables on which they operate. Ultimately, I'd like to combine the two state sets into a single state set which can operate on either pv1 or pv2, depending on which of the two variables I "pass" into it. Does the state notation compiler allow for such functionality? Any help would be greatly appreciated.Thanks, Bradley Pietrzak Indiana University Center for the Exploration of Energy and Matter /* Sample Program */ program sncExample float pv1; assign pv1 to "magnet1"; float pv2; assign pv2 to "magnet2"; ss ss1 { state one { pv1 = 1; pvPut(pv1); } state two state two { pv1 = 2; pvPut(pv1); } state one } ss ss2 { state one { pv2 = 1; pvPut(pv2); } state two state two { pv2 = 2; pvPut(pv2); } state one }