NurApiTagReadTag Method

Read tag's memory.

Definition

Namespace: NurApiDotNet
Assembly: NordicID.NurApi.Net (in NordicID.NurApi.Net.dll) Version: 4.0.0
C#
public byte[] ReadTag(
	uint passwd,
	bool secured,
	byte rdBank,
	uint rdAddress,
	int rdByteCount
)

Parameters

passwd  UInt32
Password to use if required.
secured  Boolean
Set true if secured tag
rdBank  Byte
Memory bank to read from.

Password/reserved memory: BANK_PASSWD

EPC memory: BANK_EPC

TID memory BANK_TID

User memory: BANK_USER

rdAddress  UInt32
Word address for read operation
rdByteCount  Int32
Number of bytes to read. This must divisible by two.

Return Value

Byte
Array of bytes from tag memory

Example

Example shows how to read 32 words from user memory. The tag has been retrieved from the tag storage.

The tag 'aTag' has been retrieved from the tag storage after an inventory (see example in Inventory(Int32, Int32, Int32)).

C#
int rdByteCount;
byte []userMemory;

rdByteCount = 32 * 2;    // Make byte length.            

// The tag is internally selected by its EPC contents.
// Password is not used in this read.
try
{
    []userMemory = aTag.ReadTag(0, false, NurApi.BANK_USER, 0, rdByteCount);
}
catch (NurApiException e)
{
    HandleReadError(e.error);
}

See Also