User's Manual

Elatec GmbH
Page 33 of 50
7.2 Runtime Environment
7.2.1 Include File
The file sys.twn.h declares all constants and system function prototypes, which are necessary for
accessing the TWN3 transponder reader functionality. It is strongly recommended to include this file in
any TWN3 script:
#include <sys.twn.h>
7.2.2 Basic Definitions
In order to handle boolean operations in a more natural way, there are two constants defined:
const byte FALSE = 0;
const byte TRUE = 1;
System functions, which only return 0 or 1 in order to signal successful operation, are described to
return FALSE or TRUE for better readability.
7.2.3 Bit Fields
Many system functions operate on an array of bytes, where a count of bits is and/or a start bit is
specified. The table shows, how the bits are enumerated within the array of bytes:
Byte Index 0 1 2
Bit Index 0 1 2 3 4 5 6 7 8 9 10
11
12
13
14
15
16
17
18
19
20
21
22
23
Functions, which only specify a bitcount, operate on bits 0 to bitcount-1.
Functions, which specify a startbit and bitcount, operate on bits startbit to startbit+bitcount-1.
Please note, that both the most significant bits and the most significant bytes are still oriented to the left
side of the bit field.
7.2.4 Startup Condition
Following conditions are met, before a TWN3 script is started:
The entire variable data space is preset to 0.
All timers are stopped.
The LEDs are turned off.
The volume of the beeper is set to minimum level but not turned off (volume 1).
The communication with the transponder reading module is restarted.