C Control I Micro-PCB 5 V/DC, 12 Vdc Inputs / outputs 1 x digital I/O / 1 x digital input / 4 x digital I/O or analogue 198289 Hoja De Datos

Los códigos de productos
198289
Descargar
Página de 41
56
Programming the C-Control Computer 
CCBASIC is the BASIC dialect used for programming the C-control BASIC control
computer. The syntax corresponds approximately to that of standard BASIC. In
some commands there are deviations or extensions which are tailored specially to
the hardware of the control computer.
The CCBASIC of the MICRO is for the most part compatible with other versions of
the C-control I computer but fundamentally limited to 8-bit operations/instructions. 
Examples for learning CC-BASIC
On the CD you will find short examples which will explain to you the use of the BASIC
commands step-by-step.
These examples partly require a PC connection as they use the "HyperTerminal” as
means of output – you will find it in Windows under ->Program ->Accessories -
>Communication.
Start C-CONTROL IDE, load a BASIC program from the directory "BASIC”. If you
wish to load the program, you have to close HyperTerminal as otherwise the IDE will
find an occupied interface. 
Start HyperTerminal in the configuration 9600 baud, 8n1. It is now ready for the out-
put which C-control generates.
What is a Program?
A program is the description of an information processing process. In the course of
such a process, a number of output values is calculated from a number of variables
or constant input values. The output values are either the goal of the information
acquisition themselves or serve indirectly the reaction to the input values. Alongside
the actual calculations, a program can contain instructions for access to the hard-
ware of the computer or for controlling the program flow.
A BASIC program consists of several lines of a so-called source text. Each line there-
by contains one or several compute statements or control instructions. Apart from
these instruction themselves, their order determines quite significantly the informa-
tion processing mentioned at the beginning. The execution of the operations which
correspond corresponding to the instructions by the control computer takes place
sequentially, i.e. one after another. A series of program instructions with a certain
goal is also called an algorithm. Data are the objects of the information processing
process, they represent the stored information. The C-control BASIC control com-
puter processes and stores exclusively whole-numbers, numeric data – so-called
"integers” of 1 or 8 bits. A variable of 8 bits (bytes) can only accept not negative val-
ues from 0 to 255. Pay attention in all calculations to the fact that the results of these
limit values are not exceeded or fallen short of as otherwise so-called "overflows”
can occur.
25
Mathematische und logische Operatoren
Dieses Kapitel gibt einen kompletten Überblick über die CCBASIC Operatoren,
Funktionen und Anweisungen.
• Grundrechenarten: + - * /
• Der Modulooperator MOD liefert den Rest einer Integerdivision,
a = 10 MOD 3
ergibt beispielsweise für a den Wert 1.
• Vergleichsoperatoren:
> (größer als), < (kleiner als), >= (größer oder gleich), <= (kleiner oder gleich), =
(gleich), <> (ungleich)
Das Ergebnis einer Vergleichsoperation ist entweder -1 bzw. 255 (Vergleich wahr)
oder 0 (Vergleich falsch).
a=lO <3
ergibt beispielsweise für a den Wert 0.
• logische Operatoren: 
NOT (Negation), AND (Und-Verknüpfung), NAND (Und-Verknüpfung mit anschließen-
der Negation), OR (Oder-Ver-knüpfung), NOR (Oder-Verknüpfung   mit anschließen-
der Negation), XOR (Exklusiv-Oder-Verknüpfung). Die logischen Operatoren können
außer zur Formulierung von Bedingungen (meist in Verbindung mit Vergleichsopera-
tionen) auch für binäre Bytemanipulationen benutzt werden.
• Schiebeoperatoren: 
SHL (nach links schieben), SHR (nach rechts schieben) werden zum bitweisen Ver-
schieben von Bitmustern in Byte- oder Wordvariablen benutzt. Links des Operators
steht der zu schiebende Wert, rechts die Zahl, um wieviel Bits verschoben werden
soll. Beim Linksschieben entspricht jede einzelne Verschiebung einer Multiplikation
mit 2, beim Rechtsschieben einer Division durch 2.
a = 10 SHL 3
entspricht also: a=10*2*2*2 und ergibt beispielsweise für a
den Wert 80.
Mathematische Funktionen und Befehle
Die Argumente x und y, je nach Funktion oder Befehl, sind stets Terme (Definition
siehe oben).