Datasheet

Increment - adds a value (given as parameter) to the value present in a chosen block
(inputblock) and writes the result to the outputblock. (Mode 3)
Decrement - subtracts a value (given as parameter) to the value present in a chosen
block (inputblock) and writes the result to the outputblock. (Mode 3, 4)
Direct Write - writes 4 value bytes and one address byte direct to the Block (Mode 3)
Restore - Writes the Date from the outputblock to the inputblock. (Mode 3, 4)
5.4.1. Initialization of a value block (INIT)
In order to use the Increment, Decrement and Restore function, the data block has to be
configured as a value block (Block Mode 3) or in transport configuration (Block Mode 0).
This function initializes the MiFare data block to the correct format. In this way an initial
value and an initial address has to be given (see Backup Configuration in chapter … for
details of the address). If the initialization is done, the block mode can changed to 4 via the
STM command. The block has to be writeable, in block mode 0 or 3. When authenticated
with key B and key B is readable, the block is not read/writable.
Instruction:
VAL<SPACE>INIT<SPACE>[Value]<SPACE>[Block
No.]<SPACE>[Address]<CR>
Parameter Description
Value Signed and always positive 4 byte, hexadecimal Value
Block No. The data block to modify, in decimal,
i.e. for MiFare 1k 0..63, for MiFare 4k 0..255
Address Initial address, one decimal byte
Table 11: Init mode parameter description
Response, if successful:
OK!<CR>
Examples:
The Block Mode is set to mode 3 by another way. The initial value should be 2000h. The
block to configure is block number. 4.
VAL<SPACE>INIT<SPACE>00002000<SPACE>04<CR>
The Access bits are changeable and the block number 5 should become a value block with
write and increment rights. The initial value should be 2020h.
VAL<SPACE>INIT<SPACE>SAB<SPACE>WI<SPACE>00002020<SPACE>05<CR>
Now the block becomes Mode 4. The value is only a dummy.
metraTec MiFare Protocol Guide Page 28 of 38