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: Hyperterminal-CC Kategorie: Programmierung Basic (von Michael Scherk - 19.06.2005 12:36)
 Als Antwort auf Re: Hyperterminal-CC von Achim - 31.05.2005 13:12
Michael Scherk nutzt:  CC1-Station V1.1, CC1-Station V2.0

> > Ich möchte via Hyperterminal(RS232) bei meiner CC1 Unit die Ports ein und auschschalten.
> > Wie mache ich das?

Ich habe es so gelöst:

**********************************************************************
#loop
if rxd then goto auswertung
goto loop

#auswertung
get wert
if wert = 99 then goto ausgabe
if wert = 11 then goto K1AN
if wert = 10 then goto K1AUS
if wert = 21 then goto K2AN
if wert = 20 then goto K2AUS
goto loop

#ausgabe
print "Ausgang K1: ";
if K1=-1 then print "AUS"
if K1=0 then print "AN"
print "Ausgang K2: ";K2
if K2=-1 then print "AUS"
if K2=0 then print "AN"
goto loop

#K1AN
K1=ON
goto loop

#K1AUS
K1=OFF
goto loop

#K2AN
K2=ON
goto loop

#K2AUS
K2=OFF
goto loop

********************************************************
Das ist jetzt frei aus dem Kopf, ich hoffe, ich hab keinen Syntaxfehler eingebaut ;-)
Musst halt noch die Variablen definieren, "Wert" als byte, und die Ports.

Grüße,
Michael

 Antwort schreiben

Bisherige Antworten: