GR Framework / MODBUS on Raspberry Pi - Scientific IT

Transcription

GR Framework / MODBUS on Raspberry Pi - Scientific IT
Member of the Helmholtz Association
GR Framework / MODBUS on
Raspberry Pi
May 4 – 5, 2013
PythonCamp 2013 Cologne | Josef Heinen
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
Josef Heinen, Forschungszentrum Jülich, Peter Grünberg Institute, Scientific IT Systems
2
GR – layer structure
IPython / PyPy! C / C++"
…"
GR!
Pascal"
Fortran"
GLGr!
C / C++ / clang"
Graphics Kernel System (GKS)!
Qt"
gksqt"
May 4 – 5, 2013
X11"
Quartz"
GKSTerm"
Win32"
Java"
gksweb"
PS" PDF" SVG"
…"
OpenGL (ES)!
Apple iOS!
logical device drivers / plugins:"
– CGM, GKSM, GIF, RF, UIL"
– WMF, Xfig"
– GS (BMP, JPEG, PNG, TIFF) "
Josef Heinen, Forschungszentrum Jülich, Peter Grünberg Institute, Scientific IT Systems
3
GR – interfaces
PyQt4 / wxPython "
Qt / wx event loop"
IPython"
socket communication"
glgr / iGR App!
C / Objective-C!
GR!
OpenGL!
ES!
GKS!
GKS logical device drivers!
Qt"
gksqt"
May 4 – 5, 2013
X11"
Quartz"
GKSTerm"
Win32"
Java"
PS" PDF" SVG"
…"
gksweb"
Josef Heinen, Forschungszentrum Jülich, Peter Grünberg Institute, Scientific IT Systems
4
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
Josef Heinen, Forschungszentrum Jülich, Peter Grünberg Institute, Scientific IT Systems
5
GR3 – layer structure
C / C++"
IPython / PyPy!
GR!
..."
GLUT"
GR3!
POV-Ray
generation"
POV-Ray!
off-screen
rendering"
direct
rendering"
..."
Qt4"
JavaScript
generation"
Browser!
WebGL"
GKS!
May 4 – 5, 2013
OpenGL (WGL / CGL / GLX)"
Josef Heinen, Forschungszentrum Jülich, Peter Grünberg Institute, Scientific IT Systems
6
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
Josef Heinen, Forschungszentrum Jülich, Peter Grünberg Institute, Scientific IT Systems
7
Raspberry Pi in action …
May 4 – 5, 2013
Josef Heinen, Forschungszentrum Jülich, Peter Grünberg Institute, Scientific IT Systems
8
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
Josef Heinen, Forschungszentrum Jülich, Peter Grünberg Institute, Scientific IT Systems
9
MODBUS Test Scenario
May 4 – 5, 2013
Josef Heinen, Forschungszentrum Jülich, Peter Grünberg Institute, Scientific IT Systems
10
MODBUS Station Graph (for Test Scenario)
May 4 – 5, 2013
Josef Heinen, Forschungszentrum Jülich, Peter Grünberg Institute, Scientific IT Systems
11
Demonstration
May 4 – 5, 2013
Josef Heinen, Forschungszentrum Jülich, Peter Grünberg Institute, Scientific IT Systems
12
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.
May 4 – 5, 2013
Josef Heinen, Forschungszentrum Jülich, Peter Grünberg Institute, Scientific IT Systems
13

Similar documents