Datasheet

command also has a direct write mode, marked with the first parameter “DRT”. The number
of bytes will not be checked in this mode and it depends on the second parameter (Data).
To write to MiFare Ultralight cards (which only have four bytes per block) the first parameter
becomes “W4”. This parameter writes 4 bytes to the card.
The selected block has to be writable for this command to work.
AT TENT ION
If you write wrong data to the trailer block of a sector (the fourth block of
every sector, e.g. block 3, 7, 11, etc.), the sector may become locked forever
or be even unreadable afterwards. We recommend to use the STM command
to change the information in the trailer blocks and don't write data to it
directly (although it is possible).
Instructions:
Write 16 Bytes:
WDT<SPACE>[Data]<SPACE>[Block No.]<CR>
Write 4 Bytes:
WDT<SPACE>W4<SPACE>[Data]<SPACE>[Block No.]<CR>
Write directly:
WDT<SPACE>DRT<SPACE>[CMD]<SPACE>[Data]<SPACE>[Block No.]<CR>
Parameter Description
Data Hexadecimal ASCII-String which represents the data. The length depends on
whether “DRT” or “W4” is set. If W4 is set the length is 8 ASCII characters (4
bytes). If nothing is set, then it is 32 ASCII characters (16 bytes).
W4 Write 4 bytes (for MiFare Ultralight)
DRT If set: the direct mode will be used
CMD Only with “DRT”, transponder specific write command (see datasheet)
Block No. Absolute zero based block no. which should be written
Table 6:Write command parameter description
Response, if successful:
OK!<CR>
Examples:
Write 16 bytes to block 18d
metraTec MiFare Protocol Guide Page 20 of 38