Das Open-Control-Projekt - Die Alternative zur C-Control-I


Das Forum zur C-Control-1
Welche C-Control-Varianten existieren?
Übersicht - Suchen - Neueste 50 Beiträge - Neuer Beitrag - Login - Registrieren
INFO - FAQ - CC2-Forum - CCPro-Forum 

 Re: Programm löscht sich ???? Kategorie: Programmierung C (von Hanns - 11.02.2008 19:28)
 Als Antwort auf Re: Programm löscht sich ???? von Stephan B. - 10.02.2008 21:23
Hanns nutzt:  CC1-M-Unit V1.1, CC1-M-Unit V1.2/2.0, Micro, Open-Micro
> Guten Abend Hans,
>
> für meine Anwendung habe ich eine Industrietypen der Firma Megatron (Typ M409) benutzt.
> Der Preis lag, wenn ich mich nicht Irre bei ca 140 €. Ich benutze jetzt aber noch einen anderen,
> dieser ist aber ein Analoger (Typ: MAB 25A 9bit 5V).Dieser hat den Vorteil das er nur einen Analogen Port
> benutzt und um die 40€ kostet.
> Weitere Informationen über diese Melder bekommst Du auf der Internetseite (www.megatron.de)
> ich hoffe es hilf Dir weiter.
>
> Gruß Stephan

hallo
danke Stefan,werde sicher was finden

mfg

>
>
> > > Einen schönen Tag die Runde,
> > >
> > > ich bin noch Anfänger was die Programmierung angeht und aus diesem Grunde
> > > habe ich für folgendes Problem keine Lösung.
> > > Meine Anwendung läuft einige Zeit(Tage -Wochen) fehlerfrei.
> > > Irgendwann steigt das Programm aus und läst sich nicht mehr starten.
> > > Die Anwendung wird täglich um 9:00 eingeschaltet und gegen 17:00 ausgeschalten.
> > > Die Störung läst sich erst nach einem neu Einpielen des Programms beseitigen.
> > > Die Hardware besteht aus einer Controll Unit-M 2.0 10*Relais(siehe Programm unten) und IIC-Bus Porterweiterungs Modul an der ein Absolutwertgeber angeschloßen ist.
> >
> > hallo Stefan
> > welchen Geber verwendest du und welche Bezugsquelle
> > suche schon seit längeren einen Absolutwertgeber, find aber nur teure Industrietypen
> > mfg Hans
> >
> > > Das Programm liest den Absolutertgeber aus und schaltet die 10 Relais in abhänigkeit des Wertgebers.
> > > Ich habe zwei identische Schaltungen, die aber zu unsterschiedlichen Zeiten Abstürzen.
> > >
> > >
> > > Über eine hilfestellung würde ich mich freuen.
> > > Hier das Programm:
> > >
> > >
> > >
> > > '------ I/O PORTS ---------
> > > '--------------------------
> > > define SDA          port[9]
> > > define SCL          port[10]
> > > define LIGHT        port[16]
> > >
> > > define A_1 as port[1]        'Relais 1
> > > define A_2 as port[2]        'Relais 2
> > > define A_3 as port[3]        'Relais 3
> > > define A_4 as port[4]        'Relais 4
> > > define A_5 as port[5]        'Relais 5    
> > > define A_6 as port[6]        'Relais 6
> > > define A_7 as port[7]        'Relais 7
> > > define A_8 as port[8]        'Relais 8
> > > define A_9 as port[11]       'Relais 9
> > > define A_10 as port[12]      'Relais 10
> > >
> > >
> > > define x_port byteport[3]    'Eingang Wertgeber Binär-Graycode
> > > define x_wert byte
> > > define x_r as byte           'alt wert
> > > define ax_r as byte
> > > define x as byte
> > > define temp as byte
> > >
> > > Declare Function grayToBinary(x_wert as byte)
> > >
> > >
> > > 'alle Relais aus
> > > A_1= off
> > > A_2= off
> > > A_3= off
> > > A_4= off
> > > A_5= off
> > > A_6= off
> > > A_7= off
> > > A_8= off
> > > A_9= off
> > > A_10= off
> > >
> > >
> > > x_port=11111111b
> > >
> > > x_r = 0
> > >
> > >
> > > #z
> > >  
> > > x_wert = x_port               'Wert vom Port lesen      
> > > x = grayToBinary( x_port )    'gelesenden Wert über die Funktion von Gray nach Binary umwandeln
> > >
> > > '------------Zuordnung prüfen ---------------------
> > >                                            
> > > if (temp >= 0) and (temp <=35)  then x_r = 0       'leer  
> > > if (temp >= 36) and (temp <=48)  then x_r = 1      'Relais 1
> > > if (temp >= 49) and (temp <=53)  then x_r = 0      'leer
> > > if (temp >= 54) and (temp <= 60) then x_r = 2      'Relais 2
> > > if (temp >= 61) and (temp <=66)  then x_r = 0      'leer
> > > if (temp >= 67) and (temp <= 76) then x_r = 3      'Relais 3
> > > if (temp >= 77) and (temp <= 100) then x_r = 4     'Relais 4
> > > if (temp >= 101) and (temp <=148)  then x_r = 0    'leer
> > > if (temp >= 149) and (temp <=169)  then x_r = 5    'Relais 5
> > > if (temp >= 170) and (temp <= 174) then x_r = 6    'Relais 6
> > > if (temp >= 175) and (temp <= 188) then x_r = 7    'Relais 7  2005
> > > if (temp >= 189) and (temp <= 195) then x_r = 8    'Relais 8  2006
> > > if (temp >= 196) and (temp <=203)  then x_r = 9    'Relais 9  1999
> > > if (temp >= 204) and (temp <= 208) then x_r = 0    'leer
> > > if (temp >= 209) and (temp <= 237) then x_r = 10   'Relais 10 2000
> > > if (temp >= 238) and (temp <= 255) then x_r = 0    'leer
> > >
> > > '--------------  Richtig oder falsch ----------------
> > > if x_r = ax_r then goto z
> > >
> > > if x_r = 1 then
> > >             A_1 =on  
> > >             pause 5
> > >             A_1 = off
> > >            END IF
> > > if x_r = 2 then    
> > >             A_2 =on  
> > >             pause 5
> > >             A_2 = off
> > >            END IF
> > > if x_r = 3 then
> > >             A_3 =on  
> > >             pause 5
> > >             A_3 = off
> > >            END IF
> > > if x_r = 4 then
> > >             A_4 =on  
> > >             pause 5
> > >             A_4 = off
> > >            END IF
> > >          
> > >  if x_r = 5 then
> > >             A_5 =on  
> > >             pause 5
> > >             A_5 = off
> > >             END IF
> > > if x_r = 6 then
> > >             A_6 =on  
> > >             pause 5
> > >             A_6 = off
> > >             END IF
> > > if x_r = 7 then
> > >             A_7 =on  
> > >             pause 5
> > >             A_7 = off
> > >             END IF
> > > if x_r = 8 then
> > >             A_8 =on  
> > >             pause 5
> > >             A_8 = off
> > >             END IF
> > >  if x_r = 9 then
> > >             A_9 =on  
> > >             pause 5
> > >             A_9 = off
> > >             END IF
> > > if x_r = 10 then
> > >             A_10 =on  
> > >             pause 5
> > >             A_10 = off
> > >             END IF
> > >          
> > > ax_r =x_r  
> > >            
> > > goto z
> > >
> > >
> > > end
> > >
> > >
> > >
> > >
> > > function grayToBinary(x_port as byte)
> > >    
> > >    temp = x_wert xor (x_port shr 8)
> > >  
> > >    temp = temp xor (temp shr 4)
> > >    temp = temp xor (temp shr 2)
> > >    temp = temp xor (temp shr 1)
> > >      
> > > End Function
> > >
> > > end
> > >
> > >
> > >
> > > Mfg
> > > Stephan B.

 Antwort schreiben

Bisherige Antworten: