C Control I programmer/evolution Board 8-12 Vdc Inputs / outputs - Program memory 2 kB 198302 Hoja De Datos

Los códigos de productos
198302
Descargar
Página de 40
28
FOR vl = anfangl TO ende1
. . .
GOTO anothernext
. . .
NEXT
FOR v2 = anfang 2 TO ende2
. . .
#anothernext
NEXT
Achten Sie außerdem auf den Wertebereich von Schleifenvariable und ende-Term!
DEFINE v BYTE
FOR v = 1 TO 1000
. . .
NEXT
wird zu einer Endlosschleife, da v als Bytevariable nie den Wert 1000 erreichen kann,
sondern bereits nach 255 wieder auf 0 überrollt.
• Bedingte Ausführung
IF bedingung THEN anweisungl
Die IF...THEN...Konstruktion ermöglicht die Anpassung des Programmflusses an
Bedingungen zur Laufzeit des Programms. Als bedingung ist ein beliebiger Term ein-
zusetzen. Ergibt dessen Berechnung einen Wert ungleich 0, dann gilt die Bedingung
als erfüllt, und die anweisung1 wird ausgeführt. Die gesamte IF...THEN...-Konstrukti-
on muß in einer Quelltextzeile stehen. Anweisungsblöcke (mehrere Anweisungen)
nach THEN sind nicht zulässig.
• Sprunganweisung
GOTO label
Mit der GOTO-Anweisung kann der Steuercomputer veranlaßt werden, die Pro-
grammabarbeitung an einer bestimmten Stelle fortzusetzen. Als Ziel des Sprungs
wird ein Label-Bezeichner angegeben. Das Sprungziel
kann sich vor oder nach der GOTO-Anweisung im Quelltext befinden.
• Aufruf und Rückkehr aus einer Unterroutine
Der Aufruf einer Unterroutine erfolgt mit der Anweisung
GOSUB label
53
This use leads to uncontrollable malfunctions of the C-Control and difficult to
localise errors. 
System Resources of the C-Control Computer
The term "system resources" here means all internal function units derived from the
properties of the micro-controller or provided by the operating system on the chip.
The command overview below describes how these system resources are
addressed in the BASIC program.
Realtime Clock (RTC)
An 8-bit timer clocked with 20 milliseconds runs in the background of the operating
system. Its value can be read off at any time and used to create time references in
the BASIC program and it is the basis for the internal realtime clock. 
The RTC provides the time in hours, minutes and seconds in the corresponding iden-
tifiers. 
System-induced, the accuracy of the RTC is very bad. However, you as the operator
have the possibility to improve the properties through calibration. The example
TOOL_CLOCK_CHECK.BAS gives you further notices about this topic.
The RTC can also be synchronised with a DCF77 receiver and a BASIC system
extension.  For more information, refer to the chapter "SYSTEM EXPANSIONS".
The internal memory cells for date and time can be read and described from the
BASIC program. With the description of the time memory cells, the clock can thus
also be set without DCF77 receipt. For program tests or in case of low demands on
the accuracy, you can thus do without the DCF77 antenna or the calibration. 
User Bytes
The micro-controller features altogether 240 bytes RAM. Of these, the C-Control
control computer occupies the largest share for operating system functions (stack,
timer, clock, temporary memory for computations, etc.). 24 bytes are available to the
operator for use in BASIC programs. 
The Use of these user bytes is explained in the chapter about the DEFINE command
further down.
Digital Ports
With the C-Control MICRO, all ports can assume the function of a digital port.
The available ports are PORT1, PORT2, PORT3, PORT4, PORT5, PORT6.
Other ports are accepted by the development environment (in order to maintain the
compatibility to C-control I), but their use leads to absolutely uncontrollable behav-
iour of the MICRO.