gr framework / modbus on raspberry pipgi-jcns.fz-juelich.de/...modbus_on_raspberry_pi.pdf · modbus...
TRANSCRIPT
May 4 – 5, 2013
Mem
ber o
f the
Hel
mho
ltz A
ssoc
iatio
n
GR Framework / MODBUS on Raspberry Pi
PythonCamp 2013 Cologne | Josef Heinen
May 4 – 5, 2013 2 Josef Heinen, Forschungszentrum Jülich, Peter Grünberg Institute, Scientific IT Systems
Part I: GR Framework on Raspberry Pi GR basic functionality Ø lines, marker symbols, filled polygons and text with
corresponding attributes and transformations, cell arrays Ø axes, grids, spline curves, error bars, surfaces, contours,
geometric forms, arrows, raster images, LaTeX equations Ø device and platform independent output thru logical device
drivers or plugins Ø import, export and printing of graphics Ø interoperability with Qt and wxWidgets toolkits Ø GR ctypes wrapper
May 4 – 5, 2013 3 Josef Heinen, Forschungszentrum Jülich, Peter Grünberg Institute, Scientific IT Systems
GR – layer structure
Fortran"
C / C++" …"IPython / PyPy!
GR!
C / C++ / clang"Pascal"
Graphics Kernel System (GKS)!
Win32"X11"
GLGr!
OpenGL (ES)!Apple iOS!
GKSTerm"
Java"
gksweb"
Qt" Quartz" SVG"PS" PDF" …"
logical device drivers / plugins:"– CGM, GKSM, GIF, RF, UIL"– WMF, Xfig"– GS (BMP, JPEG, PNG, TIFF) "
gksqt"
May 4 – 5, 2013 4 Josef Heinen, Forschungszentrum Jülich, Peter Grünberg Institute, Scientific IT Systems
GR – interfaces
GKS logical device drivers!
Win32"X11"
C / Objective-C!
GKSTerm"gksqt"
Qt / wx event loop"
Java"
gksweb"
SVG"
OpenGL! ES!
glgr / iGR App!
GR!
GKS!
Qt" Quartz" PS" PDF" …"
socket communication"
PyQt4 / wxPython "
IPython"
May 4 – 5, 2013 5 Josef Heinen, Forschungszentrum Jülich, Peter Grünberg Institute, Scientific IT Systems
GR3 features Ø scenes: meshes, spheres, cylinders, cones Ø properties: color, background, camera, light sources Ø export to GR (off-screen rendering), POV-Ray, HTML5
canvas Ø GR3 ctypes wrapper
May 4 – 5, 2013 6 Josef Heinen, Forschungszentrum Jülich, Peter Grünberg Institute, Scientific IT Systems
GR3 – layer structure
C / C++"
GKS!
GR! GR3!
OpenGL (WGL / CGL / GLX)"
POV-Ray!
POV-Raygeneration"
off-screen rendering"
direct rendering"
Browser!
JavaScriptgeneration"
WebGL"
GLUT" Qt4"
..."..."
IPython / PyPy!
May 4 – 5, 2013 7 Josef Heinen, Forschungszentrum Jülich, Peter Grünberg Institute, Scientific IT Systems
Installation (Raspbian "wheezy“)
sudo apt-get install libx11-dev !sudo apt-get install libxft-dev!sudo apt-get install libxt-dev!sudo apt-get install python2.7-dev!sudo apt-get install libgl1-mesa-dev !sudo apt-get install libgs-dev!sudo apt-get install texlive-latex3!sudo apt-get install dvipng!sudo apt-get install qt4-dev-tools!sudo apt-get install pyqt4-dev-tools!sudo apt-get install libwxgtk2.8-dev!sudo apt-get install python-wxgtk2.8!sudo apt-get install python-imaging!sudo apt-get install python-pyaudio!sudo apt-get install python-opengl!!git clone git://ifflinux.iff.kfa-juelich.de/gr!cd gr!export QTDIR=/usr/share/qt4!make; make install; make clean!cd examples ...!
May 4 – 5, 2013 8 Josef Heinen, Forschungszentrum Jülich, Peter Grünberg Institute, Scientific IT Systems
Raspberry Pi in action …
May 4 – 5, 2013 9 Josef Heinen, Forschungszentrum Jülich, Peter Grünberg Institute, Scientific IT Systems
Part II: Raspberry Pi + MODBUS MODBUS functionality Ø MODBUS TCP – a MB variant used for communications
over TCP/IP networks (port 502) Ø communication protocol for connecting industrial electronic
devices Ø Read/Write functions for discrete inputs / internal bits or
physical coils Ø Read/Write functions for physical input or output registers
(DI, DO, AI, AO) Ø Pure-Python wrapper
May 4 – 5, 2013 10 Josef Heinen, Forschungszentrum Jülich, Peter Grünberg Institute, Scientific IT Systems
MODBUS Test Scenario
May 4 – 5, 2013 11 Josef Heinen, Forschungszentrum Jülich, Peter Grünberg Institute, Scientific IT Systems
MODBUS Station Graph (for Test Scenario)
May 4 – 5, 2013 12 Josef Heinen, Forschungszentrum Jülich, Peter Grünberg Institute, Scientific IT Systems
Demonstration
May 4 – 5, 2013 13 Josef Heinen, Forschungszentrum Jülich, Peter Grünberg Institute, Scientific IT Systems
GR information
Ø https://iffwww.iff.kfa-juelich.de/portal/doku.php?id=gr Ø Repository: git://ifflinux.iff.kfa-juelich.de/gr Ø Co-Authors: Florian Rhiem, Ingo Heimbach, Christian
Felder, et. al.