Arduino spricht mit LOGO / Simatic S7

Begonnen von John, 10 Januar 2015, 23:44:28

Vorheriges Thema - Nächstes Thema

John

@VaidasJ

Arduino wird in jedem Fall nach 24 Stunden neu gestartet

void loop()
{
  ...
  // täglich reset 
  if (millis()>daylyResetWaiter)
  {
    SoftReset();
  }
}


Weiterhin wird die Verbindung zur Logo überwacht.
Wenn es nicht gelingt nach 3 Minuten eine Verbindung aufzubauen, dann erfolgt ebenfalls ein Reboot.

void LogoLoop()
{
...
  if (s7Client.Connected)
  {
    logoUnconnectWaiter = millis() + LGOO_CONNECT_TIMEOUT;
  }

  // wenn keine tcp connect über n sekunden, dann reboot
  if (millis()>logoUnconnectWaiter)
  {
    SoftReset();
  }
}


Eine gestörte Verbindung von weniger als 3 Minuten ist für mich unerheblich, da ich nur Temperaturen erfasse.
Insofern ist meine Verbindung stabil.

Wenn es für dich einfacher ist können wir auch Englisch sprechen.

John
CubieTruck Docker Node-Red Tasmota Shelly Homematic-IP

VaidasJ

@John

Thank you for your answer. As I stated earlier, I need to control my boiler system, e.g. mixing valve by using valve actuator and a few more zone valves and pumps. For mixing valve control I bought also analog output module, because it is easier to implement PI or PID controller for this task using proportional valve actuator instead using 3-point SPDT actuator controlled by relays (or maybe it is some good solution to control 3-point SPDT actuator). For my application I need at least 6 temperature sensors, so to buy 3 analog RTD modules is not a cheap deal. So during mixing valve control, if sensor hangs for 2 or 3 minutes due to connection problems it is not acceptable. Actually I thought it will be a more stable connection. I wanted to apply Logo commercially also in other domestic heating non-standard solutions (modernization of old heating systems in private houses with different architecture), but the price for temperature modules makes the overall solution in my country to expensive. Still it would be a great solution because of easy programming and reliable hardware.

John

@VaidasJ
I got similar trouble with the tcp/ip connection like you, so I found the described solution for me.
This is certainly not a commercially viable solution.

More I mean , for commercial use you need a CE marking for all components.

I would prefer for your case LOGO-Hardware to control the actuators and to collect  time-sensitive values

John
CubieTruck Docker Node-Red Tasmota Shelly Homematic-IP

VaidasJ

@John

Could you suggest any reliable e-shop where I could by LOGO modules and for example pt100 sensors for reasonably price? Or maybe you have tried or know some other manufacturers hardware (or some professional home automation controllers, which could be programmed) more suitable for such applications?

VaidasJ

#64
I have made recently a lot different experiments and conclusion is:
Connection is very stable if Arduino writes data often (I didn't get any single error during long time of period). But it is in case if time gap between writes does not exceed ~10s. It is very stable also if you additionally enable Logo WebService and make Web connections also.
But if time gap between writes is big enough (according experiments it is fixed and is about 10,5s), I will get error 100%. So I think it is something what I don't know in this case. Maybe it is related with Logo part. Most likely it is a connection timeout. Any thoughts? Still walk around in my case is to send Arduino status bit every 5s or so (Logo knows that with Arduino part is everything ok), send sensors data then temperature measurements are changed.

charlie71

Hallo Leute,

wirklich tolles Projekt.

Ich möchte gerne auf eine alternative Plattform, die sich ebenso mit der Arduino Oberfläche programmieren lässt, aufmerksam machen.
Ich habe schon seit 2 Monaten einen ESP8266 in Verwendung (4Mbit/Flash, 32bit CPU, über serielle Schnittstelle programmierbar, integriertes WLAN). Dieser liest Temperatur und Feuchte ein und schreibt es über Wlan in meine Logo (siehe Fotos).
One Wire Sensoren lassen sich auch anschließen.
Ach ja ein ESP12 breakout board aus China kostet < 3,-EUR.


Wenn jemand daran Interesse hat stelle ich gerne Platinenlayout und Source code zur Verfügung

lg
Charlie71

Links:
http://arduino-hannover.de/2014/12/11/wifi-kochbuch-mit-esp8266/
http://www.esp8266.com/viewforum.php?f=25
https://github.com/esp8266/Arduino



norbert21059

Hallo,

der ESP8266 ist wirklich ein tolles Teil. Ich mache auch sehr viel damit.
Jetzt will ich für einen Bekannten seinen Fronius Wechselrichter auslesen und in eine S7 schreiben.
Auslesen klappt schonmal über die Fronius API. Aber bei der S7 klemmt's.
Es gibt da eine Arduino lib -> http://settimino.sourceforge.net/
Läuft aber nicht mit ESP. Vielleicht kann ich deinen Logo-Code adaptieren?
Hab von der S7 allerdings NULL Kennung. Aber da hilft mir der Bekannte.

Hätte also Interesse am Code.

mfG u. Danke

Norbert
aktive since 2007 (?or before)
diverse Hardware most Debian
lot of Tasmota Devices

charlie71

Hallo Norbert,

sorry für den delay, die EMAIL Forenverständigung ist aus irgend einen Grund im Spam ordner gelandet.
Im Anhang der Code.

lg
Charlie71

norbert21059

Vielen Dank!

Werd's die Tage mal checken.

mfG


Zitat von: charlie71 am 11 Oktober 2016, 14:53:48
Hallo Norbert,

sorry für den delay, die EMAIL Forenverständigung ist aus irgend einen Grund im Spam ordner gelandet.
Im Anhang der Code.

lg
Charlie71
aktive since 2007 (?or before)
diverse Hardware most Debian
lot of Tasmota Devices

norbert21059

#69
Hallo Charlie71,

hat super funktioniert Deine Implementierung von Settimino für den ESP.
Ist "eigentlich" ganz einfach.
Ich hatte da wohl ein paar Verständnissprobleme. Aber jetzt ist Alles klar.
Vielen Dank nochmals!! Du hast mir (uns) sehr geholfen.
Ich häng mal meinen Code mit ran, damit Du (Ihr) sehen kannst (könnt) was draus geworden ist.
Das Prog. ist bewusst einfach gehalten und mit vielen Kommentaren versehen,
damit der Bekannte sich in die Materie einarbeiten kann.
Die Fronius-Api liefert zwar eine JSON-Datei zurück, mir ist es aber nicht gelungen mit ArduinoJson ein Ergebnis zu erzielen.
Deshalb das Parsen der einzelnen Zeilen.

Also nochmals vielen Dank.
Norbert21059
aktive since 2007 (?or before)
diverse Hardware most Debian
lot of Tasmota Devices

Mr.Burns

Hallo zusammen,

ich bin neu hier und das Thema ist auch schon etwas älter. Vielleicht kann mir trotzdem jemand helfen:

Ich habe vor, meinen RFID Leser mittels Arduino (nano) und ENC28j60 (weil ich noch so viele übrig habe) auszulesen die Nummer und an meine S7 300 zu übergeben.

Den Teil mit dem RFID Leser ist fertig und funktioniert auch schon.
Hab gesehen, das ihr das schon in Teilen fertig habt...

Gruß