JMRI: RFID Reader Support
The support on this page is rapidly evolving; the actual code might be ahead or behind the documentation on any given day.JMRI provides support for general JMRI Sensors and Reporters in terms of RFID Reader "events".
Naming
The system letter for RFID connections is "F". Details of RFID event and object names are described below.
JMRI associates RFID events with individual
JMRI objects (Sensors, Reporters, etc) via the
JMRI system names. A system name like
"FSA"
defines a Sensor that follows the "A" reader, whereas a system name like
"FRB"
defines a Reporter that follows the "B" reader.
Sensors
RFID readings coming into JMRI applications can be accessed via JMRI Sensor objects. The Sensor's system name determines which RFID Reader it corresponds to.A sensor is defined by two events: The one that sets it ACTIVE, and the one that sets it INACTIVE. When an RFID Tag is within the proximity of an RFID Reader, the associated sensor is ACTIVE; outside of these times it is INACTIVE. You create Sensors using the Add... button on the Sensor Table.
Reporters
RFID readings coming into JMRI applications can also be accessed via JMRI Reporter objects. The Reporter's system name determines which RFID Reader it corresponds to.A Reporter can contain arbitrary information, unlike a Sensor which is only ACTIVE or INACTIVE. Each Reporter is associated with some specific source of information on the layout, and makes that devices information available to the rest of JMRI.
When an RFID Reader reports that a specific tag has been seen, the corresponding Reporter will contain details of the specific IdTag seen. This then enables other JMRI tools to react to this information.
Reporter Table
The Reporter Table provides easy access to the contents of all Reporters that JMRI knows about. There's also an "Add..." button for creating your own internal Reporters; JMRI automatically creates Reporter objects for devices on the layout.Displaying Reporter Values on Panels
A Reporter's value can be displayed on a panel via an icon. To do this:- On the Panel Editor window for your panel, find the "Add Reporter" button.
- In the text box next to that button, type the user name or system name of the desired Reporter.
- Click the button. The Reporter icon will be placed on the panel. If it's not visible, that might be because the value is currently blank; use the Reporter Table to change the value to something that will be visible.
- You can drag the icon to where you want it in the usual way.
- The pop-up menu on the icon will let you change the formatting.