Zur Übersicht - INFO - Neueste 50 Beiträge - Neuer Beitrag - Suchen - FAQ - Zum CC1-Forum - Zum CC-Pro-Forum

Wichtig: Bevor Du wegen einem Problem mit der CC2 postest, stelle sicher, daß Du
die neueste OS-Version, die neuseste Compiler-DLL und die neuesten Modulversionen benutzt!
Beachte, daß sich auf der CD zur CC2-Unit/Station auch jetzt noch die ältesten Dateien befinden!
Es gelten folgende Anleitung und Regeln: Regeln CC2Net.de-Forum
Zurück zum Artikel  (Blaue Felder sind Pflichtfelder)


Name:   UserID: 
 E-Mail:
Kategorie
Betreff
Homepage:
Link-Titel:
Link-URL:
Cookie für Name, UserID, E-Mail, Homepage-URL setzen
(Erspart die Neueingabe bei Beiträgen und Antworten)
(Zum Löschen des Cookies hier klicken)
Ich nutze:
C-Control II Unit
C164CI-Controllerboard
C-Control II Station
CCRP5 mit CC2-Unit (Conrad Roboter)
CC2-Application-Board
CC2-StarterBoard
CC2-ReglerBoard
eigenes Board
original OS     OSOPT_V2     OSOPT V3.0 OSOPT V3.1

Kommentar:
Einfügen von HTML im Kommentar:

Link einfügen: <a href="LINKURL" target="_blank">LINKTITEL</a>
Bild einfügen: <img src="BILDURL">
Text formatieren: <b>fetter Text</b>  <i>kursiver Text</i> <u>unterstrichener Text</u>
Kombinationen sind auch möglich z.B.: <b><i>fetter & kursiver Text</i></b>
C2 Quellcode formatieren: <code>Quellcode</code>
ASM Quellcode formatieren: <asm>Quellcode</asm>
(Innerhalb eines Quellcodeabschnitts ist kein html möglich.)
Wichtig: Bitte mache Zeilenumbrüche, bevor Du am rechten Rand des Eingabefeldes ankommst !  

> Hallo Heiko, > > danke für Deine Hilfe, ich stelle mal den kompletten > Code ein von der Steuerung. > Ich habe das mal getestet mit long time; aber das geht > auch nicht. > Ich vermute mal ich habe weit mehr Fehler drinnen und > habe keine Ahnung wie ich weiter vorgehen soll. > Vielleicht hast du noch eine Idee. > > Gruß Rene > > <code>thread licht > { > byte port; > byte Rel; > byte day, hour, min, second; > int time; > > stports.init(); > lcdext.init(); > > /*******************************************/ > /******** ANSTEUERUNG LCD *************/ > /*******************************************/ > > lcdext.line(1); > lcdext.print(" TERRA: LICHT"); > sleep 500; > lcdext.clear(); > > /*******************************************/ > /************Zeitschaltuhr Licht************/ > /******** Es wird jeden Tag geschaltet******/ > /*******************************************/ > > loop > > { > min = system.minute(); > wait system.minute() != min; > time = system.hour()*100 + system.minute(); > day = system.dow(); > > /******************************************************/ > /********* Zeitdefinition Stunden Minuten *************/ > /************ Ein 07:00:00 Aus 18:00:00 ***************/ > /******************************************************/ > > if time >= 0700 and time <= 1800 > > stports.setRel(1,1); > else > stports.setRel(1,0); > }; > release; > }; > > thread regen > { > byte port; > byte Rel; > byte day, hour, min, second; > long time; > > stports.init(); > lcdext.init(); > > /*******************************************/ > /******** ANSTEUERUNG LCD *************/ > /*******************************************/ > > lcdext.line(2); > lcdext.print(" TERRA: REGEN"); > sleep 500; > lcdext.clear(); > > /*******************************************/ > /*********** Zeitschaltuhr Regen ***********/ > /********Es wird jeden Tag geschaltet*******/ > /*******************************************/ > > loop > > { > min = system.minute(); > wait system.minute() != min; > time = system.hour()*100 + system.minute(); > day = system.dow(); > > /**************************************************************/ > /******** Zeitdefinition Stunden Minuten Sekunden *************/ > /*** Ein 07:30:00 und 17:00:00 Aus 07:30:45 und 17:00:45 ******/ > /**************************************************************/ > > if (time >= 073000 and time <= 073045) or (time >= 170000 and time <= 170045) > > stports.setRel(2,1); > else > stports.setRel(2,0); > }; > release; > }; > > thread main > > { > byte second; > int a, b, c; > int time; > long timeset; > stports.LCDlight(1); > lcdext.init(); > lcdext.clear(); > > lcdext.print("ZEIT EINSTELLUNG"); > lcdext.line(2); > lcdext.print("BITTE EINGEBEN"); > sleep 2000; > lcdext.clear(); > lcdext.print(" STUNDE "); > sleep 2000; > lcdext.clear(); > timeset=stkeyb.input (2, 2, 5000); > a = timeset; > lcdext.clear(); > lcdext.print(" MINUTEN "); > sleep 2000; > lcdext.clear(); > timeset=stkeyb.input (2, 2, 5000); > b = timeset; > c = 00; > system.settime(a, b, c); > lcdext.clear(); > > lcdext.print("DATE EINSTELLUNG"); > lcdext.line(2); > lcdext.print("BITTE EINGEBEN"); > sleep 2000; > lcdext.clear(); > lcdext.print(" JAHR "); > sleep 2000; > lcdext.clear(); > timeset = stkeyb.input (4, 4, 5000); > a = timeset; > lcdext.clear(); > lcdext.print(" MONAT "); > sleep 2000; > lcdext.clear(); > timeset = stkeyb.input (2, 2, 5000); > b = timeset; > lcdext.clear(); > lcdext.print(" TAG "); > sleep 2000; > lcdext.clear(); > timeset = stkeyb.input (2, 2, 5000); > c = timeset; > lcdext.clear(); > system.setdate(a, b, c); > lcdext.clear(); > sleep 2000; > lcdext.print("DATE AND TIME"); > lcdext.line(2); > lcdext.print("ERFOLGREICH"); > sleep 2000; > lcdext.clear(); > > > loop > > { > second = system.second(); > lcdext.line(1); > lcdext.time(1); > lcdext.line(2); > lcdext.date(1); > sleep 500; > lcdext.goto(1,2); > lcdext.put(' '); > lcdext.goto(1,5); > lcdext.put(' '); > wait second != system.second(); > > > { > run lichtsteuerung.licht; > run regensteuerung.regen; > }; > }; > };</code> > > > > > Hallo Rene, > > > > ich kenne Deinen Code ja leider nicht (außer den zwei Zeilen, die Du dargestellt hast), > > aber wäre es möglich, dass Du bei der Variablendefinition von "time" einen Fehler gemacht > > hast? > > Bei dem von Dir dargestellten Wert von 170000 und 170045 benötigst Du nämlich einen > > Datentyp FLOAT. Byte ist sowieso zu klein und Integer hat den Wertebereich > > von &#8722;32.768 bis 32.767 ! > > > > Überprüfe das einmal! > > > > Gruß und eine schöne Weihnachtszeit, > > Heiko > > > > > > > <code>//if time >= 000020 and time <= 000030 or time >= 000110 and time <= 000120 <- Testeinstellung > > > > > > if time >= 073000 and time <= 073045 or time >= 170000 and time <= 170045</code> > > > > > > Die Einstellung mit Test dahinter geht, die andere nicht, > > > woran kann das liegen? > > > > > > Ich benötige die Sekundengenaue Steuerung, sonst ersaufen > > > meine Tiere wenn die Regenanlage loslegt. > > > > > > Gruß Rene
Dateianhang: (.gif, .png., .jpg, .zip, .rar)
max. 256kB
max. 256kB