W&T Interfaces
for TCP/IP, Ethernet, RS-232, RS-485, USB, 20mA
Glass and plastic fiber optic, http, SNMP, OPC, I/O digital, I/O analog, ISA, PCI, ...?
      Products
Home Contact   Distributors worldwide
Languages:
DE

US

ES

IT

RU
Web-IO Universal
Digital
Analog
Web-IO application-ready
Monitor climate
Alarm Reporting Center
Web-Count / S0 acquisition
IP monitoring
Data Server
Motherbox 2
pure.box 2
Network Memory
TCP/IP-Ethernet servers
Com-Server (serial)
USB Server
Serial interfaces
USB, RS232, RS485, 20mA
Isolators & fiber optics
USB, RS232, RS485, 20mA
PC cards
PCI Express, PCI and
ISA bus
...
Printer interfaces
Accessories
Downloads
Old
Shopping basket Your shopping basket

 
      Technical knowledge
Books, articles, glossaries...
Technical background info
Applications for Com-Server,
USB Server
, Web-IO,
Web Thermometer,
Motherbox and pure.box
 
Applications for Web-Thermographs:

Retrieving and displaying multiple measurements using PHP




 Additional links: Product overview Application overview Print version


When using multiple Web-Thermographs at one location, it may be desirable to display the data from the individual units on the same Web page. This is a good application for PHP.

Using the following copy & paste example you can display the measurements from multiple devices (here two Web-Thermographs) on one Web page.

For this example you need a Web server with PHP interpreter.


Do you not yet have a Web-Thermograph but would like to simply try one out like the example presented here?

No problem: We’ll send you the Web-Thermograph Pt100/Pt1000 at no charge for 30 days. Simply fill out the sample order form, and we’ll ship the Web-IO Analog-In for testing on an open invoice. If you return the unit within 30 days, we will credit the invoice in full.

To sample orders   To sample orders  

Preparations
You have already provided your Web-Thermograph(s)
  • with power,
  • connected it to your network,
  • assigned it an IP address - which with WuTility is no problem.
1. HTTP GET Header enable disable
  • So that the units do not return the entire reply header (IP address, system name, sensor part number, temperature) but rather only the measurements itself, this option must first be turned off in the device configuration:

2. Incorporate PHP script into the Web page
  • Copy the JavaScript (shown in gray) from the following example,
    e.g. into the <body> area of your Web page (PHP commands are interpreted at any desired location on the page).
  • Modify the red IP address, the green HTTP port and the blue query command to your purposes.

<html>
<head>
<title>Temperature</title>
</head>
<body bgcolor="#FFFFFF" text="#000000">

<?
function getvalue($address,$sensorno){
$datei = fsockopen($address,80);
$out = "GET /Single".$sensorno." HTTP/1.1\r\n\r\n";
fwrite($datei, $out);
while (!feof($datei)) {
$data = fgets($datei);
}
$find = "/r/n";
$pos = strpos($data, $find);
$value = substr($data,$pos);
echo $value;
fclose($datei);
}
?>

<br>

<?
getvalue ("192.168.0.2","1");
?>

<br>

<?
getvalue ("192.168.0.3","1");
?>

</body>
</html>


3. Output
  • If you save the above PHO page on a PHP server and open it using a Web browser, you get the following view:

4. Automatic updating
  • To update the page cyclically, insert the following line into the <head> area of the page.
  • The interval is given in seconds (shown here in red: 60 seconds

<html>
<head>
<title>Temperature</title>

<meta http-equiv=refresh content=60>


</head>
<body bgcolor="#FFFFFF" text="#000000">

...


5. Modify the page to your purposes
  • Using the above procedure you can simply create overview pages which can include any number of measurements:

To sample orders   To sample orders  

 

Previous application
Previous application
Next application
Next application
 
  • Mister Wong
  • Google Bookmarks
  • Twitter
  • Facebook
  • Digg
   Imprint
We are here for you personally! Wiesemann & Theis GmbH Tel.: +49 202/2680-110 (M-F 8:00 - 5:00)
Porschestr. 12 fax: +49 202/2680-265
42279 Wuppertal Individual e-mail

© Wiesemann & Theis GmbH, subject to error and alteration: Since we can make errors, none of our statements should be used without verification. Please report any mistakes or misunderstandings so that we can be aware of them and respond appropriately as quickly as possible.