Difference between revisions of "Component: RFID (EB052, RWD MICODE) (Wireless)"
(XML import) |
|||
(4 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
+ | |||
+ | |||
{| width="50%" | {| width="50%" | ||
|- | |- | ||
Line 5: | Line 7: | ||
|- | |- | ||
| width="20%" style="color: gray;" | Version | | width="20%" style="color: gray;" | Version | ||
− | | | + | | 2.0 (Release) |
|- | |- | ||
| width="20%" style="color: gray;" | Category | | width="20%" style="color: gray;" | Category | ||
Line 19: | Line 21: | ||
==Examples== | ==Examples== | ||
− | |||
===Reading the status=== | ===Reading the status=== | ||
The status of the RFID module is read using the "GetRFIDStatus" macro which returns a byte which is then displayed using the PORTB pins. | The status of the RFID module is read using the "GetRFIDStatus" macro which returns a byte which is then displayed using the PORTB pins. | ||
− | |||
{{Fcfile|RFID_ex1.fcfx|RFID Status}} | {{Fcfile|RFID_ex1.fcfx|RFID Status}} | ||
− | |||
− | |||
Status byte breakdown for Mifare. | Status byte breakdown for Mifare. | ||
Line 50: | Line 48: | ||
Example which talks to a ICode type card and allows the data to be read and written via a keypad. | Example which talks to a ICode type card and allows the data to be read and written via a keypad. | ||
− | |||
{{Fcfile|RFID_ex4.fcfx|RFID Read/Write}} | {{Fcfile|RFID_ex4.fcfx|RFID Read/Write}} | ||
− | |||
− | |||
===Macro compatibility=== | ===Macro compatibility=== | ||
Line 63: | Line 58: | ||
===<span style="font-weight: normal;"><u><tt>GetRFIDTypeID</tt></u></span>=== | ===<span style="font-weight: normal;"><u><tt>GetRFIDTypeID</tt></u></span>=== | ||
− | + | Collects the 3 bytes required to determine which kind of MIFARE device is present. Stores the result into the local buffer 0 - 2 and returns the response of the module. | |
− | |||
− | |||
'''Parameters''' | '''Parameters''' | ||
Line 78: | Line 71: | ||
===<span style="font-weight: normal;"><u><tt>WriteRFIDBlock</tt></u></span>=== | ===<span style="font-weight: normal;"><u><tt>WriteRFIDBlock</tt></u></span>=== | ||
− | + | Writes a block of information to the RFID device. | |
− | |||
− | |||
'''Parameters''' | '''Parameters''' | ||
:[[Variable Types|BYTE]] ''Address'' | :[[Variable Types|BYTE]] ''Address'' | ||
+ | ::Remote RFID Block Address. | ||
:[[Variable Types|BYTE]] ''Key_Type'' | :[[Variable Types|BYTE]] ''Key_Type'' | ||
Line 95: | Line 87: | ||
===<span style="font-weight: normal;"><u><tt>WriteRFIDModule</tt></u></span>=== | ===<span style="font-weight: normal;"><u><tt>WriteRFIDModule</tt></u></span>=== | ||
− | + | Stores a byte of data to the internal EEPROM of the RFID module at the address specified. | |
− | |||
− | |||
'''Parameters''' | '''Parameters''' | ||
Line 112: | Line 102: | ||
===<span style="font-weight: normal;"><u><tt>DecrementRFIDValue</tt></u></span>=== | ===<span style="font-weight: normal;"><u><tt>DecrementRFIDValue</tt></u></span>=== | ||
− | + | Perfoms a 32-bit decrement on the number held in location page or block. | |
− | |||
− | |||
'''Parameters''' | '''Parameters''' | ||
:[[Variable Types|BYTE]] ''Src'' | :[[Variable Types|BYTE]] ''Src'' | ||
+ | ::Page / Block | ||
:[[Variable Types|BYTE]] ''Dst'' | :[[Variable Types|BYTE]] ''Dst'' | ||
+ | ::Page / Block | ||
:[[Variable Types|BYTE]] ''Key_Type'' | :[[Variable Types|BYTE]] ''Key_Type'' | ||
+ | ::Needed for MIFARE Commands | ||
Line 131: | Line 122: | ||
===<span style="font-weight: normal;"><u><tt>FormatRFIDValue</tt></u></span>=== | ===<span style="font-weight: normal;"><u><tt>FormatRFIDValue</tt></u></span>=== | ||
− | + | Initialises the internal buffer of the Microcontroller so that it is ready to perform a Increment, Decrement or Transfer command. | |
− | |||
− | |||
'''Parameters''' | '''Parameters''' | ||
Line 146: | Line 135: | ||
===<span style="font-weight: normal;"><u><tt>IncrementRFIDValue</tt></u></span>=== | ===<span style="font-weight: normal;"><u><tt>IncrementRFIDValue</tt></u></span>=== | ||
− | + | Perfoms a 32-bit increment on the number held in location page or block. | |
− | |||
− | |||
'''Parameters''' | '''Parameters''' | ||
:[[Variable Types|BYTE]] ''Src'' | :[[Variable Types|BYTE]] ''Src'' | ||
+ | ::Page / Block | ||
:[[Variable Types|BYTE]] ''Dst'' | :[[Variable Types|BYTE]] ''Dst'' | ||
+ | ::Page / Block | ||
:[[Variable Types|BYTE]] ''Key_Type'' | :[[Variable Types|BYTE]] ''Key_Type'' | ||
+ | ::Needed for MIFARE Commands | ||
Line 165: | Line 155: | ||
===<span style="font-weight: normal;"><u><tt>StoreRFIDKey</tt></u></span>=== | ===<span style="font-weight: normal;"><u><tt>StoreRFIDKey</tt></u></span>=== | ||
− | + | Stores a 6 byte key for use with MIFARE type devices that require authorisation. | |
− | |||
− | |||
'''Parameters''' | '''Parameters''' | ||
:[[Variable Types|BYTE]] ''Key'' | :[[Variable Types|BYTE]] ''Key'' | ||
+ | ::Key Location 0 - 31 | ||
:[[Variable Types|BYTE]] ''D0'' | :[[Variable Types|BYTE]] ''D0'' | ||
+ | ::Least significant byte of key | ||
:[[Variable Types|BYTE]] ''D1'' | :[[Variable Types|BYTE]] ''D1'' | ||
Line 184: | Line 174: | ||
:[[Variable Types|BYTE]] ''D5'' | :[[Variable Types|BYTE]] ''D5'' | ||
+ | ::Most significant byte of key | ||
Line 192: | Line 183: | ||
===<span style="font-weight: normal;"><u><tt>WriteRFIDBuffer</tt></u></span>=== | ===<span style="font-weight: normal;"><u><tt>WriteRFIDBuffer</tt></u></span>=== | ||
− | + | Writes a byte of data to the outgoing buffer. | |
− | |||
− | |||
'''Parameters''' | '''Parameters''' | ||
:[[Variable Types|BYTE]] ''Address'' | :[[Variable Types|BYTE]] ''Address'' | ||
+ | ::The address of the buffer 0 - 15 | ||
:[[Variable Types|BYTE]] ''Data'' | :[[Variable Types|BYTE]] ''Data'' | ||
+ | ::The data to be stored in the buffer location 0 - 255. | ||
Line 209: | Line 200: | ||
===<span style="font-weight: normal;"><u><tt>GetRFIDStatus</tt></u></span>=== | ===<span style="font-weight: normal;"><u><tt>GetRFIDStatus</tt></u></span>=== | ||
− | + | Collect the status of the RFID device (see help for the explaination of the status byte). | |
− | |||
− | |||
'''Parameters''' | '''Parameters''' | ||
Line 224: | Line 213: | ||
===<span style="font-weight: normal;"><u><tt>ReadRFIDBuffer</tt></u></span>=== | ===<span style="font-weight: normal;"><u><tt>ReadRFIDBuffer</tt></u></span>=== | ||
− | + | Reads a byte of data from the incoming buffer. | |
− | |||
− | |||
'''Parameters''' | '''Parameters''' | ||
:[[Variable Types|BYTE]] ''Address'' | :[[Variable Types|BYTE]] ''Address'' | ||
+ | ::The address of the buffer 0 - 15 | ||
Line 239: | Line 227: | ||
===<span style="font-weight: normal;"><u><tt>TransferRFIDValue</tt></u></span>=== | ===<span style="font-weight: normal;"><u><tt>TransferRFIDValue</tt></u></span>=== | ||
− | + | Perfoms a 32-bit block data transfer on the number held in location page or block. | |
− | |||
− | |||
'''Parameters''' | '''Parameters''' | ||
:[[Variable Types|BYTE]] ''Src'' | :[[Variable Types|BYTE]] ''Src'' | ||
+ | ::Page / Block | ||
:[[Variable Types|BYTE]] ''Dst'' | :[[Variable Types|BYTE]] ''Dst'' | ||
+ | ::Page / Block | ||
:[[Variable Types|BYTE]] ''Key_Type'' | :[[Variable Types|BYTE]] ''Key_Type'' | ||
+ | ::Needed for MIFARE Commands | ||
Line 258: | Line 247: | ||
===<span style="font-weight: normal;"><u><tt>GetRFIDUID</tt></u></span>=== | ===<span style="font-weight: normal;"><u><tt>GetRFIDUID</tt></u></span>=== | ||
− | + | Collects the UID from a RFID device. Stores the result into the UID buffer and returns the response of the module. | |
− | |||
− | |||
'''Parameters''' | '''Parameters''' | ||
Line 273: | Line 260: | ||
===<span style="font-weight: normal;"><u><tt>ReadRFIDUID</tt></u></span>=== | ===<span style="font-weight: normal;"><u><tt>ReadRFIDUID</tt></u></span>=== | ||
− | + | Reads a byte of data from the UID buffer. | |
− | |||
− | |||
'''Parameters''' | '''Parameters''' | ||
:[[Variable Types|BYTE]] ''Address'' | :[[Variable Types|BYTE]] ''Address'' | ||
+ | ::The address of the buffer 0 - 7 | ||
Line 288: | Line 274: | ||
===<span style="font-weight: normal;"><u><tt>ReadRFIDBlock</tt></u></span>=== | ===<span style="font-weight: normal;"><u><tt>ReadRFIDBlock</tt></u></span>=== | ||
− | + | Reads a block of information from the RFID device. | |
− | |||
− | |||
'''Parameters''' | '''Parameters''' | ||
Line 305: | Line 289: | ||
===<span style="font-weight: normal;"><u><tt>Initialise</tt></u></span>=== | ===<span style="font-weight: normal;"><u><tt>Initialise</tt></u></span>=== | ||
− | + | Configures the RFID device by presetting the Osc type and Mode via the Flowcode component properties. | |
− | |||
− | |||
'''Parameters''' | '''Parameters''' | ||
Line 326: | Line 308: | ||
==Property reference== | ==Property reference== | ||
− | <span style="font-weight: normal;"><u> | + | <span style="font-weight: normal;"><u>Card_Type</u></span> |
− | This property is of type ''Fixed list of ints'' and can be referenced with the variable name '' | + | This property is of type ''Fixed list of ints'' and can be referenced with the variable name ''Card_Type''. |
''<span style="color:red;">No additional information</span>'' | ''<span style="color:red;">No additional information</span>'' | ||
Line 334: | Line 316: | ||
− | <span style="font-weight: normal;"><u> | + | <span style="font-weight: normal;"><u>Channel</u></span> |
+ | |||
+ | This property is of type ''Fixed list of ints'' and can be referenced with the variable name ''cal_uart::CHANNEL''. | ||
+ | |||
+ | UART Channel selector | ||
+ | |||
+ | Software channels are bit banged using generic I/O pins but are not as reliable as hardware channels. | ||
+ | |||
+ | Hardware channels use the selected peripheral on-board the target microcontroller. | ||
+ | |||
+ | <span style="font-weight: normal;"><u>Baud Options</u></span> | ||
+ | |||
+ | This property is of type ''Fixed list of ints'' and can be referenced with the variable name ''cal_uart::BAUD_LIST''. | ||
+ | |||
+ | Baud rate option selector | ||
+ | |||
+ | <span style="font-weight: normal;"><u>Baud Rate</u></span> | ||
− | This property is of type '' | + | This property is of type ''Signed integer'' and can be referenced with the variable name ''cal_uart::BAUD''. |
''<span style="color:red;">No additional information</span>'' | ''<span style="color:red;">No additional information</span>'' | ||
Line 342: | Line 340: | ||
− | <span style="font-weight: normal;"><u> | + | <span style="font-weight: normal;"><u>TX</u></span> |
+ | |||
+ | This property is of type ''Single digital pin'' and can be referenced with the variable name ''cal_uart::TX''. | ||
− | + | Pin to be used for Transmit data | |
− | + | <span style="font-weight: normal;"><u>RX</u></span> | |
+ | This property is of type ''Single digital pin'' and can be referenced with the variable name ''cal_uart::RX''. | ||
+ | Pin to be used for Receive data | ||
<span style="font-weight: normal;"><u>CTS</u></span> | <span style="font-weight: normal;"><u>CTS</u></span> | ||
Line 358: | Line 360: | ||
− | <span style="font-weight: normal;"><u> | + | <span style="font-weight: normal;"><u>Label</u></span> |
− | This property is of type '' | + | This property is of type ''Line of text'' and can be referenced with the variable name ''label''. |
''<span style="color:red;">No additional information</span>'' | ''<span style="color:red;">No additional information</span>'' | ||
Line 366: | Line 368: | ||
− | <span style="font-weight: normal;"><u> | + | <span style="font-weight: normal;"><u>Scope Traces</u></span> |
+ | |||
+ | This property is of type ''True or false'' and can be referenced with the variable name ''cal_uart::ScopeTraces''. | ||
+ | |||
+ | Selects if the scope traces are automatically added to the data recorder window or not. | ||
+ | |||
+ | Simulation - draws an approximation of the UART data onto the scope trace. | ||
+ | |||
+ | ICT - sets up the scope trace for incoming data and adds UART packet decoding at the correct BAUD. | ||
+ | |||
+ | <span style="font-weight: normal;"><u>Console Data</u></span> | ||
+ | |||
+ | This property is of type ''True or false'' and can be referenced with the variable name ''cal_uart::ConsoleData''. | ||
+ | |||
+ | Selects if the console data is automatically generated or not | ||
+ | |||
+ | <span style="font-weight: normal;"><u>Console Columns</u></span> | ||
+ | |||
+ | This property is of type ''Unsigned integer'' and can be referenced with the variable name ''cal_uart::ConsoleColumns''. | ||
+ | |||
+ | Number of characters that can be displayed on a single line of the console. | ||
+ | |||
+ | <span style="font-weight: normal;"><u>Data Source</u></span> | ||
+ | |||
+ | This property is of type ''Fixed list of ints'' and can be referenced with the variable name ''cal_uart::DataSource''. | ||
+ | |||
+ | Simulation data source used to allow the component to connect to various remote devices | ||
+ | |||
+ | Nothing - Simulation data is ignored | ||
− | + | COM port - Routes the communication data to and from a physical or virtual COM port | |
− | + | Injector - Routes the communication data via a data injector component on the Panel. |
Latest revision as of 10:31, 9 May 2018
Author | Matrix Ltd. |
Version | 2.0 (Release) |
Category | Wireless |
Contents
RFID (EB052, RWD_MICODE) component
Low level routines for controlling a RF Solutions RFID interface Allows communications between Mifare, ICode and HiTag type RFID tags. Also available in the form of the EB052 RFID E-block.
Examples
Reading the status
The status of the RFID module is read using the "GetRFIDStatus" macro which returns a byte which is then displayed using the PORTB pins.
RFID Status
Status byte breakdown for Mifare.
Status byte breakdown for ICode.
Status byte breakdown for HiTag.
Status byte breakdown for EM Marin.
Reading and Writing Data
Example which talks to a ICode type card and allows the data to be read and written via a keypad.
RFID Read/Write
Macro compatibility
Not all the macros can be used with all card types, here is a list of RFID transponder types and the macros that are compatible.
Downloadable macro reference
GetRFIDTypeID
Collects the 3 bytes required to determine which kind of MIFARE device is present. Stores the result into the local buffer 0 - 2 and returns the response of the module.
Parameters
- This macro has no parameters
Return value
WriteRFIDBlock
Writes a block of information to the RFID device.
Parameters
- BYTE Address
- Remote RFID Block Address.
- BYTE Key_Type
Return value
WriteRFIDModule
Stores a byte of data to the internal EEPROM of the RFID module at the address specified.
Parameters
- BYTE Address
- BYTE Data
Return value
DecrementRFIDValue
Perfoms a 32-bit decrement on the number held in location page or block.
Parameters
- BYTE Src
- Page / Block
- BYTE Dst
- Page / Block
- BYTE Key_Type
- Needed for MIFARE Commands
Return value
FormatRFIDValue
Initialises the internal buffer of the Microcontroller so that it is ready to perform a Increment, Decrement or Transfer command.
Parameters
- This macro has no parameters
Return value
- This call does not return a value
IncrementRFIDValue
Perfoms a 32-bit increment on the number held in location page or block.
Parameters
- BYTE Src
- Page / Block
- BYTE Dst
- Page / Block
- BYTE Key_Type
- Needed for MIFARE Commands
Return value
StoreRFIDKey
Stores a 6 byte key for use with MIFARE type devices that require authorisation.
Parameters
- BYTE Key
- Key Location 0 - 31
- BYTE D0
- Least significant byte of key
- BYTE D1
- BYTE D2
- BYTE D3
- BYTE D4
- BYTE D5
- Most significant byte of key
Return value
WriteRFIDBuffer
Writes a byte of data to the outgoing buffer.
Parameters
- BYTE Address
- The address of the buffer 0 - 15
- BYTE Data
- The data to be stored in the buffer location 0 - 255.
Return value
- This call does not return a value
GetRFIDStatus
Collect the status of the RFID device (see help for the explaination of the status byte).
Parameters
- This macro has no parameters
Return value
ReadRFIDBuffer
Reads a byte of data from the incoming buffer.
Parameters
- BYTE Address
- The address of the buffer 0 - 15
Return value
TransferRFIDValue
Perfoms a 32-bit block data transfer on the number held in location page or block.
Parameters
- BYTE Src
- Page / Block
- BYTE Dst
- Page / Block
- BYTE Key_Type
- Needed for MIFARE Commands
Return value
GetRFIDUID
Collects the UID from a RFID device. Stores the result into the UID buffer and returns the response of the module.
Parameters
- This macro has no parameters
Return value
ReadRFIDUID
Reads a byte of data from the UID buffer.
Parameters
- BYTE Address
- The address of the buffer 0 - 7
Return value
ReadRFIDBlock
Reads a block of information from the RFID device.
Parameters
- BYTE Address
- BYTE Key_Type
Return value
Initialise
Configures the RFID device by presetting the Osc type and Mode via the Flowcode component properties.
Parameters
- This macro has no parameters
Return value
Simulation macro reference
This component does not contain any simulation macros
Property reference
Card_Type
This property is of type Fixed list of ints and can be referenced with the variable name Card_Type.
No additional information
Channel
This property is of type Fixed list of ints and can be referenced with the variable name cal_uart::CHANNEL.
UART Channel selector
Software channels are bit banged using generic I/O pins but are not as reliable as hardware channels.
Hardware channels use the selected peripheral on-board the target microcontroller.
Baud Options
This property is of type Fixed list of ints and can be referenced with the variable name cal_uart::BAUD_LIST.
Baud rate option selector
Baud Rate
This property is of type Signed integer and can be referenced with the variable name cal_uart::BAUD.
No additional information
TX
This property is of type Single digital pin and can be referenced with the variable name cal_uart::TX.
Pin to be used for Transmit data
RX
This property is of type Single digital pin and can be referenced with the variable name cal_uart::RX.
Pin to be used for Receive data
CTS
This property is of type Single digital pin and can be referenced with the variable name CTS.
No additional information
Label
This property is of type Line of text and can be referenced with the variable name label.
No additional information
Scope Traces
This property is of type True or false and can be referenced with the variable name cal_uart::ScopeTraces.
Selects if the scope traces are automatically added to the data recorder window or not.
Simulation - draws an approximation of the UART data onto the scope trace.
ICT - sets up the scope trace for incoming data and adds UART packet decoding at the correct BAUD.
Console Data
This property is of type True or false and can be referenced with the variable name cal_uart::ConsoleData.
Selects if the console data is automatically generated or not
Console Columns
This property is of type Unsigned integer and can be referenced with the variable name cal_uart::ConsoleColumns.
Number of characters that can be displayed on a single line of the console.
Data Source
This property is of type Fixed list of ints and can be referenced with the variable name cal_uart::DataSource.
Simulation data source used to allow the component to connect to various remote devices
Nothing - Simulation data is ignored
COM port - Routes the communication data to and from a physical or virtual COM port
Injector - Routes the communication data via a data injector component on the Panel.