Eintaster Rolladensteuerung mit S7-200

BavariaBlue

Level-1
Beiträge
9
Reaktionspunkte
0
Zuviel Werbung?
-> Hier kostenlos registrieren
hallo, hat jemand ein Programm für meine S7 226 für eine Eintaster Rolladensteuerung. Stelle mir das so vor. 1 mal Tippen, Rolladen fährt bestimmte Zeit ab bis er zu ist, während der Fahrt nochmal tippen Rolladen stoppt, nochmals tippen Rolladen fährt wieder bestimmte Zeit auf bis er auf ist.
 
Ungetestet, aber so in etwa:
Code:
[FONT=courier new]ORGANIZATION_BLOCK MAIN:OB1[/FONT][FONT=courier new]TITLE=[/FONT]
[FONT=courier new]
[/FONT]
[FONT=courier new]BEGIN[/FONT]
[FONT=courier new]
[/FONT]
[FONT=courier new]Network 1 // Maximale Fahrzeit[/FONT]
[FONT=courier new]LD     SM0.1[/FONT]
[FONT=courier new]MOVW   20, VW98[/FONT]
[FONT=courier new]
[/FONT]
[FONT=courier new]Network 2 // Rollladen 1[/FONT]
[FONT=courier new]LD     SM0.0[/FONT]
[FONT=courier new]=      L60.0[/FONT]
[FONT=courier new]LD     E0.0[/FONT]
[FONT=courier new]EU[/FONT]
[FONT=courier new]=      L63.7[/FONT]
[FONT=courier new]LD     L60.0[/FONT]
[FONT=courier new]CALL   SBR0, L63.7, VW98, A0.0, A0.1, V0.0, VD100[/FONT]
[FONT=courier new]
[/FONT]
[FONT=courier new]Network 3 // Rollladen 2[/FONT]
[FONT=courier new]LD     SM0.0[/FONT]
[FONT=courier new]=      L60.0[/FONT]
[FONT=courier new]LD     E0.1[/FONT]
[FONT=courier new]EU[/FONT]
[FONT=courier new]=      L63.7[/FONT]
[FONT=courier new]LD     L60.0[/FONT]
[FONT=courier new]CALL   SBR0, L63.7, VW98, A0.2, A0.3, V0.1, VD104[/FONT]
[FONT=courier new]
[/FONT]
[FONT=courier new]END_ORGANIZATION_BLOCK[/FONT]
[FONT=courier new]
[/FONT]
[FONT=courier new]
[/FONT]
[FONT=courier new]SUBROUTINE_BLOCK Rollladen:SBR0[/FONT]
[FONT=courier new]TITLE=[/FONT]
[FONT=courier new]
[/FONT]
[FONT=courier new]VAR_INPUT[/FONT]
[FONT=courier new]Taster:BOOL;    // Starttaster (als Flanke übergeben)[/FONT]
[FONT=courier new]Dauer:INT;    // Max. Fahrzeit in Sekunden[/FONT]
[FONT=courier new]END_VAR[/FONT]
[FONT=courier new]
[/FONT]
[FONT=courier new]VAR_IN_OUT[/FONT]
[FONT=courier new]Auf:BOOL;    // Ausgang auf[/FONT]
[FONT=courier new]Ab:BOOL;    // Ausgang ab[/FONT]
[FONT=courier new]Richtung:BOOL;    // Speicher letzte Fahrtrichtung (0=Ab, 1=Auf)[/FONT]
[FONT=courier new]Memory:DINT;    // Speicher Fahrzeit[/FONT]
[FONT=courier new]END_VAR[/FONT]
[FONT=courier new]
[/FONT]
[FONT=courier new]VAR[/FONT]
[FONT=courier new]Fahren:BOOL;    // Fahrbefehl[/FONT]
[FONT=courier new]Zeithalt:BOOL;    // Halt nach Fahrzeit[/FONT]
[FONT=courier new]Halt:BOOL;    // Stopbefehl[/FONT]
[FONT=courier new]Fahrdauer:INT;    // Aktuelle Fahrdauer[/FONT]
[FONT=courier new]END_VAR[/FONT]
[FONT=courier new]
[/FONT]
[FONT=courier new]
[/FONT]
[FONT=courier new]BEGIN[/FONT]
[FONT=courier new]
[/FONT]
[FONT=courier new]Network 1 // Starten[/FONT]
[FONT=courier new]LD     L0.0[/FONT]
[FONT=courier new]UN     L3.0[/FONT]
[FONT=courier new]UN     L3.1[/FONT]
[FONT=courier new]=      L8.0[/FONT]
[FONT=courier new]
[/FONT]
[FONT=courier new]Network 2 // Fahrzeitbegrenzung[/FONT]
[FONT=courier new]LD     SM0.0[/FONT]
[FONT=courier new]=      L60.0[/FONT]
[FONT=courier new]LD     L3.0[/FONT]
[FONT=courier new]O      L3.1[/FONT]
[FONT=courier new]=      L63.7[/FONT]
[FONT=courier new]LD     L60.0[/FONT]
[FONT=courier new]CALL   SBR61, L63.7, LW1, LD4, L8.1[/FONT]
[FONT=courier new]
[/FONT]
[FONT=courier new]Network 3 // Anhalten[/FONT]
[FONT=courier new]LD     L0.0[/FONT]
[FONT=courier new]UN     L8.0[/FONT]
[FONT=courier new]O      L8.1[/FONT]
[FONT=courier new]=      L8.2[/FONT]
[FONT=courier new]
[/FONT]
[FONT=courier new]Network 4 // Auffahren[/FONT]
[FONT=courier new]LD     L8.0[/FONT]
[FONT=courier new]UN     L3.2[/FONT]
[FONT=courier new]LD     L3.0[/FONT]
[FONT=courier new]UN     L8.2[/FONT]
[FONT=courier new]OLD[/FONT]
[FONT=courier new]=      L3.0[/FONT]
[FONT=courier new]R      L3.2, 1[/FONT]
[FONT=courier new]
[/FONT]
[FONT=courier new]Network 5 // Abfahren[/FONT]
[FONT=courier new]LD     L8.0[/FONT]
[FONT=courier new]U      L3.2[/FONT]
[FONT=courier new]LD     L3.1[/FONT]
[FONT=courier new]UN     L8.2[/FONT]
[FONT=courier new]OLD[/FONT]
[FONT=courier new]=      L3.1[/FONT]
[FONT=courier new]S      L3.2, 1[/FONT]
[FONT=courier new]
[/FONT]
[FONT=courier new]END_SUBROUTINE_BLOCK[/FONT]
[FONT=courier new]
[/FONT]
[FONT=courier new]
[/FONT]
[FONT=courier new]SUBROUTINE_BLOCK SBR_TON:SBR61[/FONT]
[FONT=courier new]TITLE=[/FONT]
[FONT=courier new]
[/FONT]
[FONT=courier new]VAR_INPUT[/FONT]
[FONT=courier new]Start:BOOL;    // L0.0[/FONT]
[FONT=courier new]PT:INT;    // LW1[/FONT]
[FONT=courier new]END_VAR[/FONT]
[FONT=courier new]
[/FONT]
[FONT=courier new]VAR_IN_OUT[/FONT]
[FONT=courier new]Memory:DINT;    // LD3[/FONT]
[FONT=courier new]END_VAR[/FONT]
[FONT=courier new]
[/FONT]
[FONT=courier new]VAR_OUTPUT[/FONT]
[FONT=courier new]Ausgang:BOOL;    // L7.0[/FONT]
[FONT=courier new]END_VAR[/FONT]
[FONT=courier new]
[/FONT]
[FONT=courier new]VAR[/FONT]
[FONT=courier new]Diff:DINT;    // LD10[/FONT]
[FONT=courier new]CV:INT;    // LW12[/FONT]
[FONT=courier new]END_VAR[/FONT]
[FONT=courier new]
[/FONT]
[FONT=courier new]
[/FONT]
[FONT=courier new]BEGIN[/FONT]
[FONT=courier new]
[/FONT]
[FONT=courier new]Network 1 // Start = Low[/FONT]
[FONT=courier new]// Bei inaktivem Start-Eingang den Speicher mit 0 beschreiben[/FONT]
[FONT=courier new]LDN    L0.0[/FONT]
[FONT=courier new]UD<>   LD3, 0[/FONT]
[FONT=courier new]MOVD   0, LD3[/FONT]
[FONT=courier new]
[/FONT]
[FONT=courier new]Network 2 // Start = High[/FONT]
[FONT=courier new]// Bei Aktivierung des Start-Eingang den Speicher mit der aktuellen Systemzeit beschreiben.[/FONT]
[FONT=courier new]LD     L0.0[/FONT]
[FONT=courier new]UD=    LD3, 0[/FONT]
[FONT=courier new]BITIM  LD3[/FONT]
[FONT=courier new]
[/FONT]
[FONT=courier new]Network 3 // Gespeicherte Zeit erkennbar machen[/FONT]
[FONT=courier new]// Ist die so gespeicherte Systemzeit zufällig gerade = 0, dann im Speicher um 1 ms erhöhen, damit die Speicherung erkannt wird[/FONT]
[FONT=courier new]LD     L0.0[/FONT]
[FONT=courier new]UD=    LD3, 0[/FONT]
[FONT=courier new]INCD   LD3[/FONT]
[FONT=courier new]
[/FONT]
[FONT=courier new]Network 4 // Timer[/FONT]
[FONT=courier new]// Ist die gespeicherte Systemzeit <>0, dann mit der aktuellen Systemzeit vergleichen und die Differenz als Timerwert ausgeben[/FONT]
[FONT=courier new]LDD<>  LD3, 0[/FONT]
[FONT=courier new]CITIM  LD3, LD8[/FONT]
[FONT=courier new]
[/FONT]
[FONT=courier new]Network 5 // Timer in Sekunden[/FONT]
[FONT=courier new]LD     SM0.0[/FONT]
[FONT=courier new]/D     1000, LD8[/FONT]
[FONT=courier new]UENO[/FONT]
[FONT=courier new]DTI    LD8, LW12[/FONT]
[FONT=courier new]
[/FONT]
[FONT=courier new]Network 6 // Ausgang[/FONT]
[FONT=courier new]// Das Timerbit setzen, wenn der Timerwert >= dem Vorgabewert.[/FONT]
[FONT=courier new]LD     L0.0[/FONT]
[FONT=courier new]UW>    LW1, 0[/FONT]
[FONT=courier new]UW>=   LW12, LW1[/FONT]
[FONT=courier new]=      L7.0[/FONT]
[FONT=courier new]
[/FONT]
[FONT=courier new]END_SUBROUTINE_BLOCK[/FONT]
 

Anhänge

  • Eintaster-Rollladen.rar
    8,7 KB · Aufrufe: 60
Zuviel Werbung?
-> Hier kostenlos registrieren
super danke!
wenn ich 2 mal innerhalb 10 Sec den Taster tippe sollen alle Rollos auffahren (Zentralsteuerung) und 3 mal innerhalb von 10 sec den Taster tippe sollen alle Rollos zufahren. wie kann ich das verwirklichen? danke!
 
So in etwa wie im Anhang.

Aber mal ehrlich - in meinen Augen ist das ein total untaugliches Bedienkonzept. Mit diesen Codetasten innerhalb einer Zeit sind doch Fehlbedienungen vorprogrammiert:
-Woher weiß man, wann die Erfassungszeit vorbei ist und man einen weiteren Befehl eingeben kann, z.B. um einen falschen Befehl wieder aufzuheben. 10 Sekunden können verdammt lang sein, deshalb hab' ich auch erstmal nur die Hälfte genommen.
-Ein Stop kann man so frühestens 10 (5) Sekunden nach dem Fahrbefehl senden.
-Ein Zentraler Stop sollte sicher auch noch nachprogrammiert werden.


Und warum nimmst Du nicht vernünftige Rollladentaster (mit jeweils eigener Auf- und Abtaste) am jeweiligen Rollladen. Alle Tastbefehle unter z.B. 2 Sekunden sind Kurzzeitfahren, darüber geht der Rolladen in das Komplettfahren über. So kannst Du den Rollladen wenigstens auch mal vernünftig positionieren. Und für die Zentralbefehle dann einen separaten Zentraltaster.
So'n Taster kostet ja nun wirklich nicht die Welt.
 

Anhänge

  • Eintaster-Rollladen.rar
    10,1 KB · Aufrufe: 26
Zuletzt bearbeitet:
Öhm,
hucki, bei allem Spaß am programmieren, meinst Du nicht das sich der TE einmal selbst etwas Mühe geben sollte das Codebeispiel zu modifizieren? Davon lebt das Forum:).

Gruß
Mario
 
Zuviel Werbung?
-> Hier kostenlos registrieren
Hallo Mario,

ich geb' Dir da prinzipiell recht.
Ich denke aber, hier haben wir es mit einem Häuslebauer zu tun und keine HA.
Und auch dann hab' ich mit dem Programm immer noch keine fertige Lösung sondern nur ein einfaches Prinzip geliefert. Dieses muss er trotzdem auf seine Grundlagen übertragen. Mal sehen ob er damit klar kommt. Ansonsten sollte er eh' ganz die Finger davon lassen.
 
Ja ich bin Häuslebauer und habe zur Zeit wenig Zeit mich mit der Programmierung zu beschäftige. Ich habe jetzt eingesehen das es mit 2 Tastern besser ist, vor allem wenn die Endschalter der Motoren keine Rückmeldung herausgeben und man nie weis wo die Rolladen wirklich stehen. Hätte jemand vielleicht ein Programm mit 2 Tastern mit integrierter Zentalsteuerung? (Ich habe pro Stockwerk 7 Gruppen an Rolladen zu steuern und 2 Stockwerke) (Je Stockwerk ein Zentraltaster) Danke!
 
Zuviel Werbung?
-> Hier kostenlos registrieren
super danke!
wenn ich 2 mal innerhalb 10 Sec den Taster tippe sollen alle Rollos auffahren (Zentralsteuerung) und 3 mal innerhalb von 10 sec den Taster tippe sollen alle Rollos zufahren. wie kann ich das verwirklichen? danke!
Hab' mein Rollladenprogramm mit einem Modul für einen Code-Taster aufgemotzt. Vlt. ist das jetzt was für Dich.
 
Zurück
Oben