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

Códigos do produto
198302
Página de 40
52
Download into C-CONTROL MICRO
In order to download a user program from the development environment, keep the
button "DOWNLOAD" depressed 
and slide the slider switch to the position "ON"
(towards the interface plug). The readiness for download is indicated with the yellow
LED (L5).
Now you can load the program into C-CONTROL. Activate the download in the menu
DEVELOPMENT > LOAD TO C-CONTROL.
A window shows the start and the end of the download. Close this window after the
download and put the slider in the OFF position. After 2 seconds, put it to ON again
in order to start the example program.
ATTENTION!
Never use Port 3 in applications where it is not sure that Port 3 is log. high when
applying the operating voltage. Otherwise, the download mode is active and
the user program does not run.
Remove JP2 if there are problems with the download (normally not required).
Examples
Load the examples in order to familiarise yourself with the programming language.
For principle explanations about CCBASIC, refer to the following chapter.
The Programming Language CCBASIC
The Concept of C-Control MICRO/MICRO PCB
The MICRO versions of C-CONTROL are designed to realise smaller control func-
tions with a minimum extent of components and on the smallest space. Six ports
that can have several different functions (also within a program) allow multifarious
use. The operating system is also tuned to fit the purpose. It consists of the KERNEL
and offers the programmer an only slightly reduced functionality with respect to the
C-Control M/UNIT. For special requirements, Conrad Electronic provides operating
system extensions and drivers that do however reduce the usable BASIC program
memory.
Without additional modules, you can use 2 kB BASIC memory which is also sufficient
for complex applications
in the application range.
The standard BASIC development environment is used for editing and compiling the
BASIC source code. This ensures maximum compatibility and enables the porting of
programs or program parts for the versions Unit and M.
Therefore you as a programmer have to make absolutely certain that no key-
words are used in your programs that are not a part of the BASIC kernel on the
MICRO / MICRO PCB.
29
Dabei ist label der Anfangspunkt der Unterroutine. In den sogenannten Unterroutinen
sind Programmabschnitte zusammengefaßt, die mehrfach im Verlauf der Pro-
grammabarbeitung benötigt werden. Eine Unterroutine beginnt stets mit einem
Label, enthält dann eine oder mehrere Anweisungen und abschließend ein RETURN
Nach dem RETURN wird die Programmabarbeitung mit der Anweisung nach dem
GOSUB fortgesetzt. Die Programmabarbeitung darf ohne ein vorheriges GOSUB
niemals an eine RETURN-Anweisung gelangen.
Die maximal zulässige Verschachtelungstiefe bei Aufrufen von Unterroutinen aus
Unterroutinen ist vier.
#hauptprogramm
GOSUB subl
. . .
#subl
GOSUB sub2
. . .
RETURN
#sub2
GOSWB sub3
. . .
RETURN
#sub3
GOSUB sub4
. . .
RETURN
#sub4
. . .
RETURN
• Programmende
END
Gelangt der Steuercomputer im Verlauf der Programmabarbeitung zur END-Anwei-
sung, wird die Programm-abarbeitung beendet. Das System verharrt dann in einem
inaktiven Zustand. 
• Verzögerung des Programmflusses
Die Anweisung
WAIT conditionterm unterbricht die Programmausführung solange, bis die Berech-
nung des conditionterm einen Wert ungleich 0 ergibt.