Sample Usage - Panduit PViQ PU 1 User Manual

Pviq networked pou
Table of Contents

Advertisement

Sample Usage

The simplest way to get data from a Current Monitoring Meter into a script is via the XML page. Simply
performing an HTTP GET (as a web browser does) on http://<IP address of meter>/data.xml will
download the XML file. The following examples assume that the meter's IP address is 192.168.123.123.
Perl Example:
using LWP::UserAgent;
my $ip = "192.168.123.123";
my $browser = LWP::UserAgent->new;
$browser->timeout(5);
my $xmlFile = $browser->get("http://" . $ip . "/data.xml" )->content;
At this point, $xmlFile will contain the text of data.xml, ready to be parsed however necessary.
Unix/Linux Command Line Example:
wget http://192.168.123.123/data.xml
This command will download data.xml into the current directory. At this point, the file is ready to be used
by any local application or script.
18
Networked POU
Version 1.0

Advertisement

Table of Contents
loading

Table of Contents