C Control The I Unit-M Advanced 5 Vdc Inputs / outputs 16 x digital I/Os / 8 x analogue or digital I/Os Program memory 2 198805 Datenbogen

Produktcode
198805
Seite von 42
will result in global variables. More can be found in the chapter „Functions“. 
 
Prior to use a variable has do be declared otherwise an error message will occur at compilation.  
 
BYTE Variables 
Byte (value 0 ... 255) is the smallest numeric data type, ocupies 1 Byte = 8 Bit 
 
define MyByte as byte 
 
 
 
 
WORD Variables 
Word (value -32768 ... 32767) this data type occupies 2 Byte = 16 Bit 
 
define MyWord as word 
 
 
 
FLOAT Variables 
While the C-Control M 2.0 has just BYTE and WORD Types, even for non professionals easy to handle, the 
M ADVANCED has a new Data Type Float. It consists on one byte exponent and 3 byte mantissa with sign. 
Therefore a floating point value occupies 4 bytes (32 bit). 
Please see the chapter FLOATING POINT MODULE for details. 
 
 
 
CONSTANTS 
In programming, a constant is a value that never changes. The other type of values that programs use is 
variables, symbols that can represent different values throughout the course of a program. A constant can be 
- a number, like 25 or 3.6 
- a character, like a or $ 
- a character string, like "this is a string"  
Constants never change at runtime, they are constant.  
Numeric constants are generally decimal system based but BASIC++ supports the binary,octal, hexadecimal 
system also. See the next chapter for details. 
 
const MyConstant = 122 
 
POINTER 
There is one Interrupt Vector INTERRUPT available that serves for the immediate reaction either on an 
external request (negative edge at IRQ) or an internal request (e.g Timer Interrupt). See Chapter CONFIG 
REGISTER for further information. Any user interrupt is inhibited if no interrupt vector is defined. 
 
 
INTERRUPT MyInterruptService 
 
DATA TYPES 
Except the Floating Point Module (contained only in the C-Control Unit ADVANCED) there are only 3 Data 
Types used Bit, Byte and word. 
A bit status is alwas defined by boolean ON (true=logic high) and OFF(false=logic low). A byte or word 
content  is always defined as a value which can be expressed in different number systems.The applied 
system has to be identified if other than decimal system based constants are used:  
 
Examples for different number systems  
 
01011101b      binary system  
123o                oktal system  
1AFh               hexadecimal system  
1000               decimal system  
 
6