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
24
Definition von Digitalports
In CCBASIC wird auf Ports wie auf Variablen zugegriffen. Auch hier muß jeder ver-
wendete Port zuvor definiert sein.
• Definition eines der 6 Digitalports:
DEFINE bezeichner PORT[nr]
ACHTUNG:
Bei der C-Control MICRO können alle Ports die Funktion eines Digitalports anneh-
men.
Die verfügbaren Ports sind PORT1, PORT2, PORT3, PORT4, PORT5, PORT6.
Andere Ports werden von der Entwicklungsumgebung zwar akzeptiert (um die Kom-
patibilität zu C-Control I zu wahren), jedoch führt deren Verwendung zu absolut
unkontrollierbaren Verhalten der MICRO
DEFINE bezeichner BYTEPORT[nr]
DEFINE bezeichner WORDPORT[nr]
werden vom Compiler zwar zugelassen dürfen, aber nicht verwendet werden, da die
MICRO strikt Byte orientiert ist.
Ihre Verwendung  kann zu unkontrolliertem Verhalten der MICRO führen
Definition von Analogports
In CCBASIC wird auf Ports wie auf Variablen zugegriffen. Auch hier muß jeder ver-
wendete Port zuvor definiert sein.
• Definition eines der 4 A/D-Ports:
DEFINE bezeichner AD[nrl
Dabei sind für nr Werte von 1,2,5 oder 6  zulässig.
ACHTUNG:
Andere Ports werden von der Entwicklungsumgebung zwar akzeptiert (um die Kom-
patibilität zu C-Control I zu wahren), jedoch führt deren Verwendung zu absolut
unkontrollierbarem Verhalten der MICRO
57
a = 255 + 1 
results, for example, for ‘a’ in the value 0 and not 256 if ‘a’ only represents one byte!
Basic Elements of CCBASIC
General
Each program line contains one or several instructions which are separated by
colons :.
Line numbers, as customary in former BASIC dialects, are not necessary. If line num-
bers are used anyway, they can be used as a branch target.
10 . . .
GOTO 10
The numbers have no influence on the order of the program operations over and
above that. If, for example, in the source text a line 100 follows a line numbered 200,
the line 200 is processed before the 100 nevertheless. 
Commentaries can be taken up in the source text to explain the written program and
increase its readability and maintainability. A commentary in CCBASIC always
begins with a high comma ’ and explains text in the rest of which does not belong to
the program.
a =b +c ´ . . . Commentary . . .
Identifiers
Identifiers are program elements made up of alphanumeric symbols (A to Z, 0 to 9)
which designate objects such as variables and constants in the manner determined
by the programmer. Label names and the so-called "reserved words” are also identi-
fiers. No differentiation is made between capital and small letters. An identifier
always begins with a letter or with an underline. Blanks are not allowed within an
identifier.
Variables and constants
Variables and constants are objects of the information processing process.
Both store a numerical value in CCBASIC. While the value of a constant is stated
once and then remains unaltered, the value of a variable can be altered in the course
of the program as often as desired. Constants can be stated in CCBASIC in decimal,
hexadecimal and binary form. The syntax for hexadecimal and binary figures is
shown here by the example of the number 46 (decimal):
&H2E
&B101110