pvbrowser / pvb Goto Github PK
View Code? Open in Web Editor NEWHMI and SCADA
Home Page: http://pvbrowser.org
License: Other
HMI and SCADA
Home Page: http://pvbrowser.org
License: Other
This is pvbrowser: ####################################################### Make sure you have installed: Linux: g++ make qt-4.x Windows: Qt SDK from qtsoftware MinGW Make sure you have not blocked port 5050 with your firewall OS-X: xcode X11User.pkg qt-4.x OpenVMS: CXX ####################################################### The package includes the compiled programs + libs + sourecode Install with: Linux: tar -zxf pvb.tar.gz cd pvb ./clean.sh ./build.sh su ./install.sh exit Windows: Use executables within pvb\win-mingw\bin or install from install-pvbrowser.exe available on our homepage OS-X: read Readme_for_Apple_Users.txt Have a lot of fun ! Yours pvbrowser community ### Linux ############################################# build: ./build.sh clean: ./clean.sh install: su ./install.sh exit uninstall: su cd /opt/pvb ./uninstall.sh exit run: pvbrowser pvdevelop start example pvserver: cd /opt/pvb/pvserver ./processviewserver -sleep=100 OR cd /opt/pvb/pvsexample ./pvsexample -sleep=100 Build with VTK: download VTK5.x from http://www.kitware.com/VTK download cmake (See: readme.html within VTK package) configure VTK with: build shared libraries: ON wrap Tcl: ON install VTK cd pvb/pvbrowser edit pvbrowser.pro and uncomment USE_VTK make clean make su cp pvbrowser /usr/local/bin/pvbrowservtk exit ### Windows ########################################## build: cd win-mingw # edit login.bat and define environment variables QTDIR and MINGWDIR # to point to the executables of qmake.exe, mingw32-make.exe and the C++ compiler login.bat build.bat run: pvbrowser pvbrowservtk pvdevelop ### OpenVMS ########################################## build: @vms_build.com In SYLOGIN.COM or LOGIN.COM define symbol rlsvgcat := disk:[path]rlsvgcat.exe ### Building and installing server components only ### This is usefull for linux servers that do not have an up to date Qt library and you want to use it as server only. In this case only the libraries and the command line utilities are build. ./clean.sh ./build_server_components_only.sh su ./install.sh exit ######################################################
Compiling the project using build.sh gave the following error:
When USE_VTK:
QVTKWidget.cpp: In constructor ‘QVTKWidget::QVTKWidget(QWidget*)’:
QVTKWidget.cpp:106:23: error: ‘f’ was not declared in this scope
: QWidget(parent, f | Qt::MSWindowsOwnDC), mRenWin(NULL),
^
QVTKWidget.cpp: In member function ‘virtual bool QVTKWidget::event(QEvent*)’:
QVTKWidget.cpp:392:12: error: ‘TRUE’ was not declared in this scope
return TRUE;
^~~~
When Not USE_VTK:
g++ -static-libgcc -Wl,-O1 -Wl,-rpath-link,/usr/lib/x86_64-linux-gnu -o pvbrowser main.o mainwindow.o dlgopt.o opt.o tcputil.o interpreter.o MyWidgets.o MyTextBrowser_v5pc.o mywebenginepage.o QDrawWidget.o QImageWidget.o qwtplotwidget.o dlgtextbrowser.o dlgmybrowser.o pvglwidget.o gldecode.o qrc_pvbrowser.o moc_mainwindow.o moc_dlgopt.o moc_MyWidgets.o moc_MyTextBrowser_v5pc.o moc_mywebenginepage.o moc_qimagewidget.o moc_qdrawwidget.o moc_qwtwidgets.o moc_qwtplotwidget.o moc_dlgtextbrowser.o moc_dlgmybrowser.o moc_pvglwidget.o -ldl ../qwt/lib/libqwt.a -lQt5WebEngineWidgets -lQt5PrintSupport -lQt5UiTools -lQt5Svg -lQt5Widgets -lQt5Multimedia -lQt5WebEngineCore -lQt5Quick -lQt5Gui -lQt5WebChannel -lQt5Qml -lQt5Network -lQt5Positioning -lQt5Xml -lQt5Core -lGL -lpthread
interpreter.o: In function Interpreter::interpretv(char const*)': interpreter.cpp:(.text+0x3f99): undefined reference to
pvVtkTclWidget::interpret(char const*, ...)'
interpreter.cpp:(.text+0x3fd1): undefined reference to pvVtkTclWidget::updateGL()' interpreter.cpp:(.text+0x4289): undefined reference to
pvVtkTclWidget::interpretFile(char const*)'
interpreter.o: In function Interpreter::interpretQ(char const*)': interpreter.cpp:(.text+0x9765): undefined reference to
pvVtkTclWidget::pvVtkTclWidget(QWidget*, char const*, int, int*)'
collect2: error: ld returned 1 exit status
Makefile:265: recipe for target 'pvbrowser' failed
Other information might be helpful:
sys: ubuntu 18.04
VTK 5.10 compiled from source
tcl/tk8.5 installed from apt
Couldn't find any issue tracking on pvbrowser.org
Working my way through the tutorial, made a lua project, immediately ran into problems with "Action->Start Server" This requires "xterm" to be installed, which I didn't have. I worked around that, but it still never starts any server, it just fails to find a font and sits there. Running "xterm" from the same shell launches a terminal, so that's working at least, and the missing font is then just a warning.
$ pvdevelop
find
loaded the Generic plugin
xterm: cannot load font '-misc-fixed-medium-r-semicondensed--13-120-75-75-c-60-iso10646-1'
Hi,
I have added some basic name mangling to the pvdevelop tree to allow usage of C style identifiers as widget names. The reason for that is that I wanted to reference directly to named abstract run-time properties in order to prototype more rapidly.
The support is however quite basic and will require way more testing. Also, I am unable to cover the lua wrapper side testing for now, so I'd be happy if someone with lua experience would review and assist with testing.
The modifications: https://github.com/hackfin/pvb/tree/netpp_mods
Example usage for mangling to be effective:
When adding a widget, prefix the ObjectName
in the Dialog with a '_', for example: _Stream.HandledData
. If not prefixed, names will be emit like usual and not mangle characters that might break compilation.
In the process, it turned out to make sense to rewrite the parser, hopefully eliminating some more issues with lost widget properties.
QT official MinGW 4.9.2 does not bring libiberty.a,so can not compile pvbrowser. Is there any way to solve it?
The error msg is:
mingw32-make -f Makefile.Release
mingw32-make[1]: Entering directory 'D:/SCADA/pvb/win-mingw/pvbrowser'
g++ -mthreads -Wl,-s -Wl,-subsystem,windows -o release\pvbrowser.exe object_scri
pt.pvbrowser.Release -lmingw32 -LD:/Qt/Qt5.5.0/5.5/mingw492_32/lib -lqtmain -ls
hell32 -lws2_32 ../../qwt/lib/libqwt.a D:\Qt\Qt5.5.0\Tools\mingw492_32/lib/libbf
d.a D:\Qt\Qt5.5.0\Tools\mingw492_32/lib/libiberty.a D:\Qt\Qt5.5.0\Tools\mingw492
_32/lib/libmangle.a D:\Qt\Qt5.5.0\Tools\mingw492_32/lib/libopcodes.a -lQt5OpenGL
-lQt5PrintSupport -lQt5UiTools -lQt5WebKitWidgets -lQt5Svg -lQt5Widgets -lQt5Mu
ltimedia -lQt5WebKit -lQt5Gui -lQt5Network -lQt5Xml -lQt5Core
g++: error: D:\Qt\Qt5.5.0\Tools\mingw492_32/lib/libiberty.a: No such file or dir
ectory
Makefile.Release:151: recipe for target 'release\pvbrowser.exe' failed
mingw32-make[1]: *** [release\pvbrowser.exe] Error 1
mingw32-make[1]: Leaving directory 'D:/SCADA/pvb/win-mingw/pvbrowser'
makefile:34: recipe for target 'release' failed
mingw32-make: *** [release] Error 2
hi!
In a medium size program, I feel it running slower in time.
My pvserver is keeping low in resources, but pvbrowser is continuously increasing it's consumption of both CPU and RAM.
Is there something to be aware when programming an app?
I took care of using pvDownloadFile only once at program starting for getting all application artwork.
And I think my program has no memory leaks. (I suppose I'd see this memory leaks in server not in pvbrowser client, isn't it?)
Program is not finished so is not still public :-/ if source code is important I'll have to speed up all the process.
thanks!
<tl;dr>Does the pvQVtkTclWidget support a user interaction callback to the main program? From the code, I think it does not?</tl;dr>
Full story: pvQVtkTclWidget() is set up and commanded through TCL, without any feedback (afaik), its tricky / impossible (for me at least) to get the interactor feedback to the program.
There might be two main pathways to implement this:
Yet to my knowledge, neither is available in pvbrowser?
Do you have a suggestion on how to pass back a user interaction with this VTKwidget?
Say, a mouseover or mouseclick in the VTK-space, or even more specific: vtkPointPicker info?
As we do get position and click data in canvas (in C++), and the picking info in TCL (as a picker object) ,but this info on the object interaction -to my knowledge- is not available in C++?
Dear Author:
Is your project support to parse the protocol of diffirent PLC(such as AB, Simens, Panosonic)?
Up to now, i just see the protocols that support Modbus, SiemensTCP from the source. Am i right?
Please correct me if i am wrong. Thank you!
Hi @pvbrowser and community
Is any way to have a responsive GUI with pvbrowser?
If not, are there future plans to support it?
Cheers
Hi!
I've encounter a problem writting signed integer with function:
writePresetSingleRegister(int slave, int adr, int value)
the problematic line is:
data[2] = value/256; data[3] = value & 0x0ff;
where I think we find a calculation error in value/256 , changing this, perhaps a little bit out of control operation (unsigned char = int/int), with a bit moving operation solve the issue for me.
data[2] = value>>8; data[3] = value & 0x0ff;
So that, I can now correctly write/read signed integers to a PLC.
Also:
cheers, and thanks for the effort!
pd: tests I did:
----- FOR VALUE: 32643 -----
RLMODBUSCLIENT: old telegram, slave:1 , highaddress:3 lowaddress:232, highvalue:127 lowvalue:131
RLMODBUSCLIENT: new telegram, slave:1 , highaddress:3 lowaddress:232, highvalue:127 lowvalue:131
----- FOR VALUE: -32643 -----
RLMODBUSCLIENT: old telegram, slave:1 , highaddress:3 lowaddress:232, highvalue:129 lowvalue:125
RLMODBUSCLIENT: new telegram, slave:1 , highaddress:3 lowaddress:232, highvalue:128 lowvalue:125
----- FOR VALUE: 255 -----
RLMODBUSCLIENT: old telegram, slave:1 , highaddress:3 lowaddress:232, highvalue:0 lowvalue:255
RLMODBUSCLIENT: new telegram, slave:1 , highaddress:3 lowaddress:232, highvalue:0 lowvalue:255
----- FOR VALUE: -255 -----
RLMODBUSCLIENT: old telegram, slave:1 , highaddress:3 lowaddress:232, highvalue:0 lowvalue:1
RLMODBUSCLIENT: new telegram, slave:1 , highaddress:3 lowaddress:232, highvalue:255 lowvalue:1
Please help me with this:
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
pvbrowser-devel : Depends: qt5-default but it is not installable
Depends: xterm
Depends: ffmpeg
Depends: libavcodec-dev but it is not going to be installed
Depends: libavcodec58
Depends: libqt5multimedia5 but it is not going to be installed
Depends: libqt5help5 but it is not going to be installed
Depends: libqt5webenginecore5 but it is not going to be installed
Depends: libqt5multimediawidgets5 but it is not going to be installed
Depends: libqt5webengine5 but it is not going to be installed
Depends: libqt5webenginewidgets5 but it is not going to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).
when running the command pvdevelop it returns a command line:
####################################################
####################################################
usage: pvdevelop <-action=> <-programming_language=language> <-fake_qmake> <-h> project
example: pvdevelop pvs
example: pvdevelop -action=writeInitialProject pvs
-action=writeInitialProject
-action=insertMask
-action=make
-action=makeModbus
-action=makeSiemensTCP
-action=makePPI
-action=uncommentRLLIB
-action=uncommentModbus
-action=uncommentSiemensTCP
-action=uncommentPPI
-action=writeStartscript
-action=writeDimension::
-action=importUi:
-action=exportUi:
-action=designerUi:
-action=dumpTranslations
-programming_language=<Lua|Python>
I'm expecting a graphical interface. Am I doing something wrong?
Hi community,
Has anyone tried to use pvbrowser with zigbee devices? as for example an arduino x-bee?
It could be possible to have a shared mailbox with our SCADA?
Sorry if I am asking something completly crazy (I've not an informatics profile) , but it could be nice to have small devices distributed easy to connect with as modbus for example.
Hi!
Is it possible to use QT inside a pvb app?
I mean, one disadvantage of QT is the need of calling QT app and gui for using elements as QPaint. But I have no idea with the pvserver structure how to get it.
Has anyone tried this?
Thanks!
Hello I'm using the rllib as a standalone project. Right now the rlsiemenstcp class is unnecessarily slow on my system (Ubuntu 12.04 64 bits). After some research and benchmarking comparison with libnodave, I've found that the main reason is that rlsiemenstcp does two writes to the socket for each request. There are several ways to avoid the delay use one write (copy header and buffer to one total buffer and send that), use TCP_NODELAY, use non NONBLOCKING or clever use of TCP_CORK. I attach an easy solution using the first option:
int rlSiemensTCP::write_iso(unsigned char *buf, int len)
{
int i,ret, total_len;
char stack_buf[512];
char *total_buf=0;
if(rlSocket::isConnected() == 0) doConnect();
if(rlSocket::isConnected() == 0) return -1;
ih.version = 3;
ih.reserved = 0;
ih.length_high = (len+4) / 256;
ih.length_low = (len+4) & 0x0ff;
if(len <=0)
{
rlDebugPrintf("write_iso:failure to write iso packet negative length -> disconnecting\n");
rlSocket::disconnect();
}
total_len = len + sizeof(ih);
if(total_len > sizeof(stack_buf))
{
total_buf = new char[len + sizeof(ih)];
}
else
{
total_buf = stack_buf;
}
memcpy(total_buf, &ih, sizeof(ih));
memcpy(total_buf+sizeof(ih), buf, len);
ret = rlSocket::write(total_buf, total_len);
if(total_len > sizeof(stack_buf))
delete [] total_buf;
if(ret < 0)
{
rlDebugPrintf("write_iso:failure to write iso packet -> disconnecting\n");
rlSocket::disconnect();
return ret;
}
if(rlDebugPrintfState != 0)
{
::printf("write_iso() len=%d\n", len);
for(i=0; i<len; i++) ::printf("%02x,",buf[i]);
::printf("\n");
}
return len;
}
I think TCP_NODELAY would be a better solution since it avoids copying memory, but I haven't implemented it since it will either break expectations from other users of rlSocket, or it will break rlSocket API. I also don't have all the platforms where rllib is being used so I can't test TCP_NODELAY.
By my measurements, grouping those two writes gives me ~6x speedup (from 10s to perform 100 reads on a S71200 to 1.4 seconds) .
Regards,
V. Seguí
Hello pvbrowser community
Pvbrowser compile and works perfectly under my system, but I have not succes making rllib standalone working with python.
I've tried the build_python_interface script with this errors:
g++ -c -m64 -pipe -O2 -D_REENTRANT -Wall -W -fPIC -DQT_NO_DEBUG -DQT_SQL_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++-64 -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtSql -I/usr/include/qt4 -I/usr/include/python2.7
g++: fatal error: no input files
compilation terminated.
make: **\* [qtdatabase.o] Error 4
g++ -c -m64 -pipe -O2 -D_REENTRANT -Wall -W -fPIC -DQT_NO_DEBUG -DQT_SQL_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++-64 -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtSql -I/usr/include/qt4 -I/usr/include/python2.7
g++: fatal error: no input files
compilation terminated.
make: **\* [language_binding_rllib_wrap_python.o] Error 4
cp: no se puede efectuar `stat' sobre «lib_pv.so»: No existe el archivo o el directorio
cp: no se puede efectuar`stat' sobre «lib_rllib.so»: No existe el archivo o el directorio
g++ -c -m64 -pipe -O2 -D_REENTRANT -Wall -W -fPIC -DUSE_INETD -DQT_NO_DEBUG -DQT_SQL_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++-64 -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtSql -I/usr/include/qt4 -I/usr/include/python2.7
g++: fatal error: no input files
compilation terminated.
make: **\* [qtdatabase.o] Error 4
g++ -c -m64 -pipe -O2 -D_REENTRANT -Wall -W -fPIC -DUSE_INETD -DQT_NO_DEBUG -DQT_SQL_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++-64 -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtSql -I/usr/include/qt4 -I/usr/include/python2.7
g++: fatal error: no input files
compilation terminated.
make: **\* [language_binding_rllib_wrap_python.o] Error 4
cp: no se puede efectuar `stat' sobre «lib_pv.so»: No existe el archivo o el directorio
cp: no se puede efectuar`stat' sobre «lib_rllib.so»: No existe el archivo o el directorio
compiling pvbrowser gives me the same errors.
my system specifications are a bare Ubuntu 14.04 64 bits
If I try this piece of code:
import sys, os pvslib_path = '/opt/pvb/language_bindings/python/mt' sys.path.insert(0, pvslib_path) import rllibI get this error:
File "./main.py", line 48, in
import MtoDBc_data
File "/home/prointegra/Documentos/desarrollo/respositorios_git_dev/MtoDB_/MtoDBc_data.py", line 11, in
import rllib
File "/opt/pvb/language_bindings/python/mt/rllib.py", line 26, in
_rllib = swig_import_helper()
File "/opt/pvb/language_bindings/python/mt/rllib.py", line 22, in swig_import_helper
_mod = imp.load_module('_rllib', fp, pathname, description)
ImportError: dynamic module does not define init function (init_rllib)
thanks!
Hi!
I've been trying out your binaries of the web for a while, and I've found the Xenial Qt4 version doesn't work. it depends of obsolete libqt4-webkit and it doesn't exist anymore.
changing it dependency to libqtwebkit4 does the trick.
I tell you here, because I don't know the correct communication channel, and so, also, perhaps can help someone reading.
cheers, and thanks for the project!
@pvbrowser we have developed a pvs application with grid and line drawing. We followed the sample in the open source. It is very handy ! however we met an issue - the text can not be fully displayed. The snapshot is attached in this post.
We are using linux framebuffer mode on tuchscreen device. The font can support Chinese, but even we only draw English words, it still happens.
note only Ubuntu, it is no problem with English words only.
Any suggestions will be really appreciated.
Hi,
Has anyone got experience working with Bachmann MX213 using modbus over TCP? The modbus daemon seems able to read in some value from the register but the return value is -1. I guess the connection between the daemon and the plc is not thru.
Thanks,
Dave
We tested a simple pvs application with the pvb on a touchscreen tablet, with tslib and linux buffer frame mode.
We noticed a problem. In a mask with multiple buttons, when we touch button A, then button B, then button A... The event ID received in the pvs is often the previous button pressed, rather than current pressed button.
We have a theory about it but not confirmed yet: the PVB may only update the mouse position on MOUSE_OVER and MOUSE_RELEASE event, but on touchscreen there is no MOUSE_OVER event, so when touch down a button, the mouse position used is actually for previous pressed button.
We have very little knowledge about QT and PVB internals. Can anyone give some advices and clues here? much appreciated!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.