LogoopenSUSE Build Service > Projects > home:pvbrowser > Overview
Sign Up | Log In

pvbrowser's Home Project

###############################################################
pvbrowser based HMI/SCADA as open source software
###############################################################

pvbrowser (R)
http://pvbrowser.org
is a HMI/SCADA framework with data aquisition,
that is developed as open source.
It does not work with an HTML based browser,
instead a browser that is optimized for HMI is used.

The system is platform independent and runs on
Linux/Unix, Windows and Mac OS-X.
The Server can also be used on OpenVMS.

###########
principle
###########

The principle is shown on
http://pvbrowser.de/pvbrowser/pic/prinzip.png

A background process (daemon) cyclically reads the process variables
from a PLC or fieldbus system and
stores the values in a shared memory.
At the same time the daemon waits on it's mailbox for outgoing commands,
that will be send to the PLC or the fieldbus.

A shared memory is a piece of RAM that many processes can access at the same time.
The parallel access can be coordinated (mutex).
A mailbox is a mechanism for communication between processes on the same computer.
It is organized as fifo (first in first out).
Many processes can write to it at the same time.
Only one process is allowed to read.

Once process variables are within the shared memory the
visualization can easily read them.
Also the visualization can output values over the mailbox.

It is also possible that more processes access the shared memory and the mailbox
(Soft PLC, technological models, quality systems ...).

The main visualization works according to the client/server principle.
On the computers of the users the client (pvbrowser) is running.
This client can be compared to a web browser but
instead of displaying almost static HTML pages pvbrowser shows
dynamic changing graphical object (widgets).

The client uses the platform independent library Qt4
http://trolltech.com/products/qt/features
thus it is working on many platforms.

The server (pvserver) is done by the programmer of the visualization 
with the help of an IDE (integrated development program) almost graphically.
But you can implement unlimited complex logic within the pvserver with C/C++.

The communication between client and server is done with TCP/IP.
Also the client and the server are sending commands over the network
that are interpreted on the other side.
The commands consist of text terminated by a newline.
So pvserver is sending commands to pvbrowser that pvbrowser then will turn into
calls to Qt methods.
At the same time pvbrowser may send commands when the user triggers an event
like button hit.

The sourcecode of a pvserver is almost completely generated and maintained
by the IDE (pvdevelop). The application programmer only has to fill out
the functions that handle the events (slot functions).
The layout of the screens is done graphically within pvdevelop.

As you see, within a visualization that is based on pvbrowser
only the server is custom specific.
The clients (pvbrowser) do not have to be changed.
Modifications are only done within the server.
The computers of the users are untouched.

As you are used from web browsers you can jump from one server
to the other by the use of hyperlinks.
Thus any complex visualization is possible.

The server does not need Qt.
For programming the server there is a library for controlling the client
http://pvbrowser.de/pvbrowser/sf/manual/html/modules.html
and a library for serverside programming
http://pvbrowser.de/pvbrowser/sf/manual/rllib/html/classes.html
These libraries are also platform independent.

Because always UTF-8 characters are used
you can do international visualizations even with non latin characters.

##################
graphical objects
##################

Within pvbrowser all graphical objects provided by Qt can be used.
Additionally there are object for
xy-graphics, bitmap graphics and vector orientated SVG graphics.
Further more you can use external plot/statistic programs
and show their results within pvbrowser.
With this also webcams are integrated.

The screenshots
http://pvbrowser.de/pvbrowser/index.php?menu=2&topic=2
show examples of visualizations done with pvbrowser.

############
programming
############

The programmer of the visualization only fills the slot functions
within the framework.
A example for a visualization with OPC XML-DA is shown (only 2 slot functions).

//----------------------------------------------------
static int slotNullEvent(PARAM *p, DATA *d)
{
  if(p == NULL || d == NULL) return -1;
  int i;
  const char *cptr;

  for(i=ID_MAIN_WIDGET+1; i<ID_END_OF_WIDGETS; i++)
  {
    cptr = toolTip[i];
    if(*cptr != '#' && *cptr > ' ') // if there is a variable name
    {
      pvPrintf(p,i,"%s=%s",cptr,opc.stringValue(cptr));
    }
  }

  pvPrintf(p,labelReadErrorCount,"readErrorCount=%d",opc.readErrorCount());
  pvPrintf(p,labelWriteErrorCount,"writeErrorCount=%d",opc.writeErrorCount());
  return 0;
}

//----------------------------------------------------
static int slotButtonEvent(PARAM *p, int id, DATA *d)
{
  if(p == NULL || id == 0 || d == NULL) return -1;
  int   ival;
  float fval;
  switch(id)
  {
    case buttonInt16:
      ival = opc.intValue("test/Int16");
      ival += 1;
      opc.writeIntValue("test/Int16",ival);
      break;
    case buttonInt32:
      ival = opc.intValue("test/Int32");
      ival += 1;
      opc.writeIntValue("test/Int32",ival);
      break;
    case buttonFloat:
      fval = opc.floatValue("test/float");
      fval += 1.0f;
      opc.writeFloatValue("test/float",fval);
      break;
    case buttonDouble:
      fval = opc.floatValue("test/double");
      fval += 1.0f;
      opc.writeFloatValue("test/double",fval);
      break;
    case buttonHello:
      opc.writeStringValue("test/string","hello");
      break;
    case buttonWorld:
      opc.writeStringValue("test/string","world");
      break;
    default:
      break;
  }
  return 0;
}

//----------------------------------------------------
Notice that the OPC value names are input within the designer as "toolTip".
Thus programming is minimal.

################
data aquisition
################

For data aquisition several protocols of the field level are supported.
http://pvbrowser.de/pvbrowser/index.php?menu=4&topic=4

If a protocol is missing there is a template for a daemon program
http://pvbrowser.de/pvbrowser/tar/opcxmlda.tar.gz
that can be used to implement data aquisition using a library from other vendors.

################################################
supervision and control of background processes
################################################

Using the pvserver pcontrol
http://pvbrowser.de/pvbrowser/index.php?menu=4&topic=4&subtopic=12
the background processes your automation is consisting of
can be started and controlled.

Furthermore this server is a central instance for output of
event messages from your background processes.

##############
test yourself
##############

pvbrowser can be downloaded from
http://pvbrowser.de/pvbrowser/index.php?menu=6&topic=6
for an OS of your choice.
Linux is the most easy OS to test because the compiler and make are installed by standard.
On windows you first have to install Visual C++ 6.0 (or higher).

For testing the pvbrowser client an example server is available on the internet at
pv://pvbrowser.de
that can be called with pvbrowser.

More info can be found on
http://pvbrowser.org
and our wiki
http://pvbrowser.de/home/mediawiki/index.php/En:pvbrowser_manual

have a lot of fun, yours:
pvbrowser community

Comments for home:pvbrowser (0)