<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Recent changes to Home</title><link>https://sourceforge.net/p/pynetvars/wiki/Home/</link><description>Recent changes to Home</description><atom:link href="https://sourceforge.net/p/pynetvars/wiki/Home/feed" rel="self"/><language>en</language><lastBuildDate>Tue, 17 Jul 2018 13:37:03 -0000</lastBuildDate><atom:link href="https://sourceforge.net/p/pynetvars/wiki/Home/feed" rel="self" type="application/rss+xml"/><item><title>Home modified by Frank Benkert</title><link>https://sourceforge.net/p/pynetvars/wiki/Home/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v3
+++ v4
@@ -43,7 +43,7 @@
 PS: Falls wir ein leeres Programm laden wollen (als Test) sollten wir nicht vergessen im (noch leeren) Programmcode der PLC_PRG einen Strichpunkt zu setzen.
 Dann ist er nicht mehr leer :-)

-### Konfigfuration Raspberry Pi
+### Configuration Raspberry Pi

 ```bash
 # Entpacken des pyNETVARS Beispiels
&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Frank Benkert</dc:creator><pubDate>Tue, 17 Jul 2018 13:37:03 -0000</pubDate><guid>https://sourceforge.net8dda886ffb885c3d49600086d949a65180e074e7</guid></item><item><title>Home modified by Frank Benkert</title><link>https://sourceforge.net/p/pynetvars/wiki/Home/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v2
+++ v3
@@ -1,4 +1,5 @@
 # HowTo
+(english version below...)

 Hier eine kurze Anleitung wie man das Python-Modul einsetzen kann.

@@ -60,8 +61,8 @@
 # Modul holen
 cp ../pyNETVARS/netvars.py .

-# unsere exportierten NetVars01.exp holen
-cp /[vonwoauchimmer]/NetVars01.exp .
+# unsere exportierten NET01RX.EXP holen
+cp /[vonwoauchimmer]/NET01RX.EXP .
 ```

 Jetzt ein Python-Skript anlegen mit ungefähr diesem Inhalt:
@@ -86,5 +87,94 @@
 ```

 Diese Werte sollten wir nun in unserem laufenden CoDeSys-Programm sehen.
-[[members limit=20]]
-[[download_button]]
+
+
+# HowTo (english)
+
+Here a short instruction how to use the Python module.
+
+## Prerequisites
+- a CoDeSys 2.3 controller (e.g. a WAGO)
+- a computer (Raspberry Pi, Fritz!Box, PC or whatever) running Python 2.7
+- the need to transfer data / measured values from this computer to CoDeSys
+- the devices must be connected to each other via network
+
+## Example
+For our scenario we assume that we have a controller with CoDeSys 2.3 and a Raspberry Pi.
+A data packet is to be sent to the controller from the Raspberry Pi. In my case, a distance is determined cyclically via an ultrasonic sensor and sent to the controller. The whole system is used to measure the level of a cistern - the ultrasonic sensor measures the distance to the water surface.
+Here, however, we only want to program the actual transmission process.
+The IP addresses of our targets are **not** important! We configure so-called [Multicast](https://en.wikipedia.org/wiki/Multicast) in order not to disturb the other network participants.
+
+### Configuration CoDeSys
+#### Target Settings
+![Zielsystemeinstellungen](https://sourceforge.net/p/pynetvars/code/ci/master/tree/doc/zielsystemeinstellungen.png?format=raw)
+
+#### Create variables
+Add global variables:
+
+![Variablen hinzufügen](https://sourceforge.net/p/pynetvars/code/ci/master/tree/doc/variablen_hinzufuegen.png?format=raw)
+
+Configure Network:
+
+![Variablen Netzwerkkonfiguration](https://sourceforge.net/p/pynetvars/code/ci/master/tree/doc/variablen_netzwerkkonfig.png?format=raw)
+
+Add a few variables:
+
+![Variablen eingeben](https://sourceforge.net/p/pynetvars/code/ci/master/tree/doc/variablen_eingeben.png?format=raw)
+
+Export variables:
+
+![Variablen exportieren](https://sourceforge.net/p/pynetvars/code/ci/master/tree/doc/variablen_exportieren.png?format=raw)
+
+e.g to the file "NET01RX.EXP".
+
+Now of course compile, load and start the program.
+
+PS: If we want to load an empty program (as a test) we should not forget to set a semicolon in the (still empty) program code of PLC_PRG.
+Then it's not empty anymore :-)
+
+
+### Konfigfuration Raspberry Pi
+
+```bash
+# Unpacking the pyNETVARS example
+unzip pyNETVARS-r0.zip
+cd pyNETVARS
+ls
+```
+
+But if we want to create our own project...
+```bash
+# create your own project...
+cd ..
+mkdir myproject
+cd myproject
+# get the module
+cp ../pyNETVARS/netvars.py .
+
+# get the exported NET01RX.EXP
+cp /[whereever]/NET01RX.EXP .
+```
+
+Now create a Python script with about this content:
+```python
+from netvars import NetVars
+
+localIf = ''
+mcastGrp = '225.10.10.10'
+mcastPort = 1202
+
+netVars1 = NetVars( 1, 'UDP', mcastGrp, mcastPort, localIf )
+netVars1.varsFromExpFile( './NET01RX.EXP' )
+netVars1.startSender()
+
+# e.g. at 63,62cm distance...
+netVars1.latestValues['NetVar01_Counter'] = 1
+netVars1.latestValues['NetVar01_ZisterneAbstandZoll'] = 25
+netVars1.latestValues['NetVar01_ZisterneAbstandZentimeter'] = 64
+netVars1.latestValues['NetVar01_ZisterneAbstandMikrosekunden'] = 3712
+
+netVars1.sendValues()
+```
+
+We should now see these values in our current CoDeSys program.
&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Frank Benkert</dc:creator><pubDate>Tue, 17 Jul 2018 13:33:37 -0000</pubDate><guid>https://sourceforge.netc8fd34aac00faa45444c4418b8414bd758e292d8</guid></item><item><title>Home modified by Frank Benkert</title><link>https://sourceforge.net/p/pynetvars/wiki/Home/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v1
+++ v2
@@ -1,8 +1,90 @@
-Welcome to your wiki!
+# HowTo

-This is the default page, edit it as you see fit. To add a new page simply reference it within brackets, e.g.: [SamplePage].
+Hier eine kurze Anleitung wie man das Python-Modul einsetzen kann.

-The wiki uses [Markdown](/p/pynetvars/wiki/markdown_syntax/) syntax.
+## Voraussetzungen
+- eine CoDeSys 2.3 Steuerung (z.B. eine WAGO)
+- ein Computer (Raspberry Pi, Fritz!Box, PC oder sonstwas) auf dem Python 2.7 läuft
+- der Wille Daten / Messwerte von diesem Computer nach CoDeSys zu bringen
+- die Geräte müssen per Netzwerk miteinander verbunden sein

+## Beispiel
+Für unser Szenario gehen wir davon aus, dass wir eine Steuerung mit CoDeSys 2.3 und einen Raspberry Pi haben.
+Auf dem Raspberry Pi soll ein Datenpaket an die Steuerung gesendet werden. In meinem Fall wird zyklisch über einen Ultraschallsensor eine Entfernung ermittelt und zur Steuerung gesendet. Das Ganze dient der Füllstandsmessung einer Zisterne - der Ultraschallsensor misst die Entfernung zur Wasseroberfläche.
+Hier wollen wir aber nur den eigentlichen Sendevorgang programmieren.
+Die IP-Adressen unserer Targets spielen **keine** Rolle! Wir konfigurieren sogenanntes [Multicast](https://de.wikipedia.org/wiki/Multicast) um die anderen Netzwerkteilnehmer nicht zu belästigen.
+
+### Konfiguration CoDeSys
+#### Zielsystemeinstellungen
+![Zielsystemeinstellungen](https://sourceforge.net/p/pynetvars/code/ci/master/tree/doc/zielsystemeinstellungen.png?format=raw)
+
+#### Anlegen der Variablen
+Globgale Variablen hinzufügen:
+
+![Variablen hinzufügen](https://sourceforge.net/p/pynetvars/code/ci/master/tree/doc/variablen_hinzufuegen.png?format=raw)
+
+Netzwerkkonfiguration:
+
+![Variablen Netzwerkkonfiguration](https://sourceforge.net/p/pynetvars/code/ci/master/tree/doc/variablen_netzwerkkonfig.png?format=raw)
+
+Jetzt ein paar Variablen eingeben:
+
+![Variablen eingeben](https://sourceforge.net/p/pynetvars/code/ci/master/tree/doc/variablen_eingeben.png?format=raw)
+
+Variablen exportieren:
+
+![Variablen exportieren](https://sourceforge.net/p/pynetvars/code/ci/master/tree/doc/variablen_exportieren.png?format=raw)
+
+z.B in die Datei "NET01RX.EXP".
+
+Jetzt natürlich Programm kompilieren, laden und starten.
+
+PS: Falls wir ein leeres Programm laden wollen (als Test) sollten wir nicht vergessen im (noch leeren) Programmcode der PLC_PRG einen Strichpunkt zu setzen.
+Dann ist er nicht mehr leer :-)
+
+### Konfigfuration Raspberry Pi
+
+```bash
+# Entpacken des pyNETVARS Beispiels
+unzip pyNETVARS-r0.zip
+cd pyNETVARS
+ls
+```
+
+Wenn wir nun aber ein eigenes Projekt anlegen wollen...
+```bash
+# eigenes Projekt anlegen...
+cd ..
+mkdir myproject
+cd myproject
+# Modul holen
+cp ../pyNETVARS/netvars.py .
+
+# unsere exportierten NetVars01.exp holen
+cp /[vonwoauchimmer]/NetVars01.exp .
+```
+
+Jetzt ein Python-Skript anlegen mit ungefähr diesem Inhalt:
+```python
+from netvars import NetVars
+
+localIf = ''
+mcastGrp = '225.10.10.10'
+mcastPort = 1202
+
+netVars1 = NetVars( 1, 'UDP', mcastGrp, mcastPort, localIf )
+netVars1.varsFromExpFile( './NET01RX.EXP' )
+netVars1.startSender()
+
+# bei z.B. 63,62cm Entfernung wären das...
+netVars1.latestValues['NetVar01_Counter'] = 1
+netVars1.latestValues['NetVar01_ZisterneAbstandZoll'] = 25
+netVars1.latestValues['NetVar01_ZisterneAbstandZentimeter'] = 64
+netVars1.latestValues['NetVar01_ZisterneAbstandMikrosekunden'] = 3712
+
+netVars1.sendValues()
+```
+
+Diese Werte sollten wir nun in unserem laufenden CoDeSys-Programm sehen.
 [[members limit=20]]
 [[download_button]]
&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Frank Benkert</dc:creator><pubDate>Tue, 17 Jul 2018 12:31:22 -0000</pubDate><guid>https://sourceforge.netf04fbc5a46b40eaae1c7a89d4671099d29f42519</guid></item><item><title>Home modified by Frank Benkert</title><link>https://sourceforge.net/p/pynetvars/wiki/Home/</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;Welcome to your wiki!&lt;/p&gt;
&lt;p&gt;This is the default page, edit it as you see fit. To add a new page simply reference it within brackets, e.g.: &lt;span&gt;[SamplePage]&lt;/span&gt;.&lt;/p&gt;
&lt;p&gt;The wiki uses &lt;a class="" href="/p/pynetvars/wiki/markdown_syntax/"&gt;Markdown&lt;/a&gt; syntax.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;h6&gt;Project Members:&lt;/h6&gt;
	&lt;ul class="md-users-list"&gt;
		&lt;li&gt;&lt;a href="/u/benkfra/"&gt;Frank Benkert&lt;/a&gt; (admin)&lt;/li&gt;
		
	&lt;/ul&gt;&lt;br/&gt;
&lt;p&gt;&lt;span class="download-button-55d04e357929e5087277f327" style="margin-bottom: 1em; display: block;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Frank Benkert</dc:creator><pubDate>Sun, 16 Aug 2015 08:47:49 -0000</pubDate><guid>https://sourceforge.netac16b20b0207138b29be194a528547c7817164c7</guid></item></channel></rss>