---
title: "NFC Reader (_NfcReader class)"
canonical: "https://docs.cuesystem.com/space/CVCHELP/512327789/NFC%20Reader%20(_NfcReader%20class)"
format: markdown
---
> Macro (toc)

---

Commands of the _NfcReader class are available only on touchCUE-7-M R09 and touchCUE-10-M panels. The variable of the type _NfcReader class is built-in and cannot be declared in the program. **For NFC reader functionality must be** **touchCUE panel equipped with an NFC module (CS0579).** 

# GetNfcCardUID

This function reads the NFC card’s unique ID. You can use this function to detect that the NFC card was removed from the NFC reader. 

#### Syntax 

```visualbasic
Function GetNfcCardUID(ByRef uid As ByteString) As Boolean
```

#### Return value 

If the NFC reader is detecting an NFC card then the function returns True and variable uid contains the unique ID of the NFC card otherwise the function returns False. 

# OnNfcCardDetected

This event is fired by the system when any NFC card is detected by an NFC reader.  

#### Syntax 

```visualbasic
Process OnNfcCardDetected(uid As ByteString)
```

#### Example

```visualbasic
// event handler OnNfcCard 
Private Process NfcReader_OnNfcCardDetected (uid As ByteString) Link NfcReader.OnNfcCardDetected 
  DebugPrintFormat("New NFC card was detected: {s}",uid) 
End Process
```

#### Example

```visualbasic
Private Process NfcReader_OnNfcCardDetected (uid As ByteString) Link NfcReader.OnNfcCardDetected 
Var currentuid As ByteString[50] 

  DebugPrintFormat("New NFC card was detected: {s}",uid) 
  Do While NfcReader.GetNfcCardUID(currentuid) 
    Wait(:0.5) 
  End Do 
  DebugPrint("NFC card was removed") 
End Process
```


# SetEnabledNfcProtocols

This function enables specified NFC card protocols.  NFC protocol ISO14443A is enabled by default in the panel.

> ℹ️ This function is supported since firmware 21.70

#### Syntax 

```visualbasic
Function SetEnabledNfcProtocols(protocols As Long) As Boolean
```


#### Parameters 

protocols

Long. This is a bit mask for NFC protocols that are to be enabled. Supported NFC protocols

_NFC_ISO14443A, _NFC_ISO15693, _NFC_ISO15693_ICLASS


#### Return value 

If the NFC reader is detecting an NFC card then the function returns True and variable uid contains the unique ID of the NFC card otherwise the function returns False.