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 

 Serial problem Kategorie: Programmierung Basic (von Hans - 31.10.2006 18:45)
Hans nutzt:  CC1-M-Unit V1.2/2.0
THANKs H.J.W

THE display is a 4x40 with 2 enable signal for IC1 and IC2
when I switch (E=ON/E=OFF)then must the print"#INIT#"; Again  (no tekst)
see circuit http://home.quicknet.nl/qn/prive/hbroersen/display.BMP

But the display reading is now good

So we want to start all over again

1 Sender en 1 reciever
serial RS485
The program works good
only +/- one out of ten is goiing wrong
then there is coming in wrong information
the number "50" (start code) is coming on Varbyte1 or Varbyte2 or Varbyte5 on wich the other variable are moving up
why is this program so unstable
or with other words, how do I get this program stable



'******Test Sender ********
put 0
led=OFF

#Start
 TOG Led
VarByte1=10
VarByte2=20
VarByte3=30
VarByte4=140
VarByte5=200
VarByte6=255

PUT 50   'is the start code
PUT VarByte1
PUT VarByte2
PUT VarByte3
PUT VarByte4
PUT VarByte5
PUT VarByte6

pause 50
GOTO Start



'******** Test Reciever  **********

AanTal=0
PRINT"#ON_LCD#";"#INIT#";"#CLR#";"#OFF#"; 'Initialize the LCD voor gebruik de IIC bus'
PUT 0

#INIT
E=ON
print"#ON_LCD#";
print"#INIT#";
print"#CLR#";
print"#L101#";
print "******       Dit is een test       *****";
print"#OFF#";
Pause 50

#OpStart
Minute = 0

#Start
IF MINUTE>4 THEN GOTO GeenOntvangst
IF NOT RXD THEN GOTO Verder
GET Var1
IF Var1=50 THEN GOTO Ontvang 'Start code
#Verder
GOTO Start

#Ontvang
GET Var1   'Óntvangen van de 48 BITS in 6 Byte's
GET Var2
GET Var3
GET Var4
GET Var5
GET Var6

#Display
aanTal=AanTal+1
E=ON
print"#ON_LCD#";
print"#INIT#";
print"#CLR#";
print"#L101#";
PRINT "Getal1=";Var1;
print"#L201#";
PRINT "Getal2=";Var2;
print"#L121#";
PRINT "Getal3=";Var3;
print"#L221#";                         'Regel 4, POSITON 1
PRINT "Getal4=";Var4;
E=OFF
pause 2
print"#INIT#";
print"#CLR#";
print"#L101#";
PRINT "Getal5=";Var5;
print"#L201#";
PRINT "Getal6=";Var6;
print"#L221#";
PRINT Aantal;
print"#OFF#";

pause 150

GOTO Opstart

#GeenOntvangst
E=ON
print"#ON_LCD#";
print"#CLR#";
print"#INIT#";
print"#L101#";
print "******       Geen ontvangst       ******";
print"#OFF#";

GOTO Opstart

 Antwort schreiben

Bisherige Antworten:

Re: Serial problem (von H.J.W. - 31.10.2006 19:26)
    Re: Serial problem (von Hans - 31.10.2006 20:02)
        Re: Serial problem (von H.J.W. - 31.10.2006 20:47)