Argonne National Laboratory

Experimental Physics and
Industrial Control System

1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  <20062007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  <20062007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017 
<== Date ==> <== Thread ==>

Subject: php module
From: Christophe Moins <christophe.moins@ego-gw.it>
To: tech-talk@aps.anl.gov
Date: Thu, 25 May 2006 09:26:15 +0200
Hello,

I am using currently the php module to display value on a web browser.
The program reads first the content of a file to get the whole list of process variables and afterwards performs a ca_get for each of them to know their value.
Times to times, the browser tries to download the page with all the values, but does not succeed and I have got a message saying "the document contains no data" although some data should be available.
The listing of the php script is the following :


<html>
<body>
<meta http-equiv="refresh" content="60" /> <?php
#interface with Epics Iocs to know the values
# of variables stored in the data file associated to the unit
#load external module
dl("php_epics.so");


       $unitName = $_GET["unit"];
       $fileName = $_GET["fileName"];
       echo "<h1>VALUES OF ".$unitName."</h1>";

#file parsing to get the variable names list
include 'GetList.php';
$variableIdent = array("record","sensor","ai","bi");
$variableList = GetList($fileName,$variableIdent);
$nbVar = count($variableList);
for ($index=0; $index < $nbVar; $index++) {
$variableName = $variableList[$index];
$variableValue = ca_get($variableName);
echo "$variableName $variableValue <BR>";
}
?>
</body>
</html>


And the GetList function is the following one :
<?php
       #file parsing to get the variable names list stored in fileName
       function GetList($fileName,$variableIdent) {
          $file=fopen($fileName,"r");
          #$variableNumber = 0;
          $variableList = "";
          $index = 0;
          while(! feof($file))
          {
             $line = fgets($file);
             $variableName = strstr($line,$variableIdent[0]);
             if ($variableName != FALSE &&
                 (strstr($line,$variableIdent[1]) != FALSE ||
                  strstr($line,$variableIdent[2]) != FALSE ||
                  strstr($line,$variableIdent[3]) != FALSE ))
             {
                $rawName = strstr($line,"\"");
                $variableName = strtok($rawName, "\"");
                $variableList[$index] = $variableName;
                $index++;
             }
          }
          fclose($file);
          return $variableList;
       }
?>

Has Anyone ever met such a problem ?

Thanks
Christophe


Navigate by Date:
Prev: Meeting Registration Reminder Andrew Johnson
Next: Minimize severity link Harley N
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  <20062007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017 
Navigate by Thread:
Prev: Meeting Registration Reminder Andrew Johnson
Next: Minimize severity link Harley N
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  <20062007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017 
ANJ, 02 Sep 2010 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·