User's Manual

Elatec GmbH
Page 27 of 44
7.1.6.12 Empty Statement
A statement, which is doing nothing is the semicolon. Example:
for (i=0; i<10; i+=1) // Waste some time and do ten times nothing
;
7.1.7 Storage Types
In the TWN3 scripting language, there is only one type of storage defined, which is the byte. A byte is
an unsigned integer with a size of 8 bits.
7.1.8 Storage Classes
There are following storage classes available: Standard, const and secret. Without using any modifier,
the standard storage is used. A variable, which is declared in the standard storage class, is allocated in
the normal data segment.
Examples:
byte i; // A single integer
byte a[15]; // An array of 15 bytes
7.1.8.1 const
An identifier, which is declared as const can be used for calculations at compile time. There is no
physical memory occupied during runtime. Typically, you would use a const for defining constants,
which are used throughout a script for easier understanding and adaptation for different purposes.
Example:
const byte c = 15;
7.1.8.2 secret
The secret data space is a read-only segment. The content of this segment is written once during
programming the script into the TWN3 transponder reader. Furthermore, this segment can not be read
directly by the script itself. Therefore, there is no way to simply read the content of this memory and
send it to the host. There are only a few system functions, which take the content of this segment as
input. Typically, the secret data space is used for keys, which are necessary for authentication to a
transponder. Examples:
// Some well known factory default keys for transponders
secret byte MifareKeyFF[6] = { 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF };
secret byte MifareKeyAA[6] = { 0xA0,0xA1,0xA2,0xA3,0xA4,0xA5 };
secret byte MifareKeyBB[6] = { 0xB0,0xB1,0xB2,0xB3,0xB4,0xB5 };
secret byte Hitag2Key[4] = { 'M','I','K','R' };
secret byte EM4050Key[4] = { 0x00,0x00,0x00,0x00 };