Argonne National Laboratory

Experimental Physics and
Industrial Control System

1994  1995  1996  1997  1998  1999  2000  2001  2002  <20032004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  <20032004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019 
<== Date ==> <== Thread ==>

Subject: Re: Maximum (Minimum) Value of a Set of Readback PVs
From: kuner <kuner@mail.bessy.de>
To: tech-talk <tech-talk@aps.anl.gov>
Date: Tue, 24 Jun 2003 18:49:55 +0200
If you want to create a state set as Tim Mooney suggested (I would prefer this solution) May be this script for a automatic snl-file generation could be helpful. You can run it to understand what happens, but it has to be adapted to your requirements.

regards

Bernhard Kuner

program PPTMOD

int stt[14];
int miscOn;
int coolingOn;

assign miscOn 	to "PPTMOD:miscOn";
assign coolingOn 	to "PPTMOD:coolingOn";

/*sorted in alphabetical order of signals*/
assign stt[5] to 	"PPTMOD:BodyWaFlSw";
assign stt[0] to 	"PPTMOD:CabDoorSw";
assign stt[6] to 	"PPTMOD:CavyWaFlSw";
assign stt[7] to 	"PPTMOD:CircWaFlSw";
assign stt[8] to 	"PPTMOD:CollWaFlSw";
assign stt[1] to 	"PPTMOD:EarthSw";
assign stt[2] to 	"PPTMOD:EmergSw";
assign stt[4] to 	"PPTMOD:GndRod";
assign stt[9] to 	"PPTMOD:LoadWaFlSw";
assign stt[11] to 	"PPTMOD:MagnWaFlSw";
assign stt[10] to 	"PPTMOD:MagnetTempSw";
assign stt[12] to 	"PPTMOD:TankTempSw";
assign stt[13] to 	"PPTMOD:TankWaFlSw";
assign stt[3] to 	"PPTMOD:eoLineMax";

monitor stt;

ss miscStates
{
  state st_miscInit
  { when()
    { miscOn=1;
      pvPut(miscOn);
    } state st_miscOn
  } 

  state st_miscOff
  { when(stt[0]||stt[1]||stt[2]||stt[3]||stt[4])
    { miscOn = TRUE;
      pvPut(miscOn);
    } state st_miscOn
  }

  state st_miscOn
  { when(!stt[0]&&!stt[1]&&!stt[2]&&!stt[3]&&!stt[4])
    { miscOn = FALSE;
      pvPut(miscOn);
    } state st_miscOff
  }
}

ss coolingStates
{
  state st_coolingInit
  { when()
    { coolingOn=1;
      pvPut(coolingOn);
    } state st_coolingOn
  } 

  state st_coolingOff
  { when(stt[5]||stt[6]||stt[7]||stt[8]||stt[9]||stt[10]||stt[11]||stt[12]||stt[13])
    { coolingOn = TRUE;
      pvPut(coolingOn);
    } state st_coolingOn
  }

  state st_coolingOn
  { when(!stt[5]&&!stt[6]&&!stt[7]&&!stt[8]&&!stt[9]&&!stt[10]&&!stt[11]&&!stt[12]&&!stt[13])
    { coolingOn = FALSE;
      pvPut(coolingOn);
    } state st_coolingOff
  }
}


References:
Maximum (Minimum) Value of a Set of Readback PVs John K Munro Jr
Re: Maximum (Minimum) Value of a Set of Readback PVs Tim Mooney

Navigate by Date:
Prev: Re: Waveform calaulation for each element Alexei Dmitrovski
Next: Re: Maximum (Minimum) Vaue of a Set of Readback PVs kuner
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  <20032004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019 
Navigate by Thread:
Prev: Re: Maximum (Minimum) Value of a Set of Readback PVs Ned Arnold
Next: R3.14 and registerRecordDeviceDriver Kate Feng
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  <20032004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019 
ANJ, 10 Aug 2010 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·