For the complete documentation index, see llms.txt. Markdown versions of documentation pages are available by appending .md to page URLs.
Skip to content

Use a card CSN as the card number

Configure a Universal Card Format to use a MIFARE Card Serial Number as cardholder data.

All MIFARE cards have a unique Card Serial Number (CSN), also known as a Unique ID (UID). A MIFARE CSN is usually either 4 bytes (32 bits) or 7 bytes (56 bits). Classic is typically 4 byte and DESFire is typically 7 byte.

Gallagher HBUS readers can be set to read the CSN from a MIFARE card and use it to identify a cardholder in Command Centre. When CSN mode is enabled on a reader, the reader sends the card's CSN to the controller as cardholder identification, if it does not detect any other form of cardholder identification on the card.

To interpret the CSN as a card number, the controller hosting the reader needs a Universal Card Format assigned that matches the length of the CSN of the MIFARE cards in use.

Configure a UCF for CSN mode

Use this procedure to create a UCF for either a 4 byte (32 bit) or a 7 byte (56 bit) CSN.

  1. Click Configure on the menu bar, then Universal Card Format. The Universal Card Format Master List window opens in grid view.

  2. Open the Universal Card Format you want to configure for CSN mode, or create a new one.

  3. Click the Format tab.

  4. Click the Wiegand radio button to indicate the required format.

  5. Complete the parameters as shown in the table below.

  6. Select the card type's facility code from the Facility Code dropdown list.

  7. Assign the UCF to the controller's Card Formats property page.

Wiegand Format field
32 bits (4 byte)
56 bits (7 byte)

Number of Bits

32

56

Bits in Facility Code

0

0

First Bit of Facility Code

n/a

n/a

Bits in Card Number

32

56

First Bit of Card Number

1

1

Bits in Issue Number

0

0

First Bit of Issue Number

n/a

n/a

Bits to Sum for Even Parity

0

0

First Bit to Sum for Even Parity

n/a

n/a

Bits to Sum for Odd Parity

0

0

First Bit to Sum for Odd Parity

n/a

n/a

Facility Code

Select from list

Select from list

Note. No bits are set for the facility code, because that data is not sent when only the CSN is retrieved. You need to create a card type with the facility code you want to use. On the Card Types Setup property page, also increase the card number range to 72057594037927935 for 56 bit cards, or 4294967295 for 32 bit cards.

Read the CSN

When a MIFARE card that has no Gallagher data is presented to a reader configured for CSN mode, an Unauthorised Card event is generated showing the card's CSN. Copy that CSN when you add the card to a cardholder.

Note. If you get a 72 bit CSN from a card presented to a Gallagher T-series reader, it is actually a 56 bit CSN with 16 extra bits added by the reader. The same applies to a 48 bit result, which is actually 32 bit. Use the underlying length, 56 or 32, for the UCF configuration.


🔗 Related

Last updated

Was this helpful?