GPIO Programming for On-Reader Applications

GPIOs (general purpose inputs/outputs) are used to do simple digital communication between the Impinj Revolution-based reader platform and external peripherals. Here is an excellent write-up on GPIO using the Impinj OctaneSdk C# framework and an Impinj GPIO box:

Impinj reader products based on the Impinj Revolution architecture, specifically models

420 (4 antenna port Reader)
220 (2 antenna port Reader)
640 (marketing name is xPortal)

have 4 GPI AND 4 GPO pins available for your use. They are exposed via the 15-pin multi-purpose port on the back of the reader. NOTE: IF YOU ARE USING THE IMPINJ  ANTENNA HUB YOU WILL **NOT** HAVE ACCESS TO THESE GPIO PORTS AS THEY ARE USED BY THE ANTENNA HUB FOR SPECIAL SIGNALLING PURPOSES. Also, please note that this port will not work with a VGA cable!

In addition to the standard way of explicitly reading/writing the state of the digital IOs, the GPIOs can be tied to certain discrete events occurring within a typical RFID environment. Examples include starting stopping the reader when a particular input goes high/low. In the field, this high/low input might come from a photo-eye which asserts the line high when an object is in the field of view and conversely sets it low when there isn't. These use-models are well-defined within standard LLRP and many reading this article are likely familiar with them.

LLRP also allows for custom "extensions" that allow reader vendors to incorporate special functionality, over and above that provided in base LLRP. In the GPIO
realm, Impinj does this via it's Advanced GPOConfiguration. 

From this note on Impinj Advanced GPO :

This custom parameter controls the advanced GPO feature of the readers. When set to Normal (default) the GPO is set via the regular LLRP SET_READER_CONFIG message. When set to Pulsed, the GPO changes state based on the SET_READER_CONFIG message, and will change to the opposite state after GPOPulseDurationMSec milliseconds. When set to Reader_Operational_Status, LLRP_Connection_Status*, or Reader_Inventory_Status, the GPO status acts like a Boolean value. When high (true, 1), the corresponding status is true, meaning the reader is operating, has a LLRP connection, or is inventorying. When low (false, 0), the opposite is the case.
Whenever a GPO has been associated with a specific reader status, it cannot be set via the normal LLRP protocol. If a SET_READER_CONFIG message is received that attempts to change the state of a GPO associated with a specific reader status, the message will be rejected by the reader.
Remember to run Enable_Impinj_Extensions() prior to using these commands.


*If using an xArray reader the LLRPConnection status is not functional.

So, if you want a GPO to be asserted when any,some or all of these RFID events:

1. The reader is operational

2. The reader has an LLRP connection established

3. The reader is actively emitting RF and trying to read tags

occur, you can do so easily with the Impinj Advanced GPO settings.

OK, so let's do some examples:

Example: Get the current GPIO values -- C++

/* Get the Current State of a GPIO Pin 
If argument isOutput = false then it's an implied Input pin.
Pin is a number in the range 1-4
 int QuickWebSample::getGpi(int port)

    int state = 0;
    CMessage *pMsg = NULL;
    list<CGPIPortCurrentState*>::iterator curr;

    CGPIPortCurrentState *pState;

    pConfig = new CGET_READER_CONFIG();

    pMsg = transact(pConfig);

    delete pConfig; /*don't need this anymore so free as we go*/

    /* Leap of faith - we should only get back a GET_READER_CONFIG_RESPONSE so just blindly cast it for this demo;
    check the type and safely cast and evaluate in production code */


    curr = pGRCRsp->beginGPIPortCurrentState();
    while ( curr != pGRCRsp->endGPIPortCurrentState() )
        if ( (*curr)->getGPIPortNum() == port )
            state = (*curr)->getState();
    delete pGRCRsp;

    return state;


Was this article helpful?
0 out of 2 found this helpful



Article is closed for comments.