Accessing Pickering Drivers from Python

Pickering drivers are standard Windows dll's and as such can be accessed from most programming languages, including Python.

To access a library, use the ctypes library, here is an example of access to the non-VISA driver PILPXI:

At the command line

from ctypes import *
pilpxi = windll.LoadLibrary("pilpxi")
ver = pilpxi.PIL_Version()

A Python Library for PILPXI

An implementation of the library is provided here

It contains 2 class definitions:

  • pilpxi_base

    contains non card-specific functions to locate PXI cards

  • pilpxi_card

    contains all the card -specific functions to access and control Pickering PXI cards


from pilpxi import *
base = pilpxi_base()
e, count = base.CountFreeCards()
e, bus, slot = base.FindFreeCards(count)
cardnum = 0
while cardnum < count:
    card = pilpxi_card(bus[cardnum], slot[cardnum])
    err, cid = card.CardId()
    print "Card ",cardnum
    print "Bus", bus[cardnum], " Device", slot[cardnum]
    print "ID = ", cid
    e, ins, outs = card.EnumerateSubs()
    print "subunits: ", ins, "input, ", outs, "output"
    sub = 1
    while sub <= outs:
        e, inf = card.SubType(sub, 1)
        print "subunit ",sub, " = ", inf
        sub = sub + 1
        cardnum = cardnum +1

In this example, pilpxi_base is used to locate all available cards. CountFreeCards returns the number of cards found, then FindFreeCards returns two arrays containing the bus and device numbers of the cards.

Next pilpxi_card is used to open each card and then basic card information is queried and the type of each subunit presented.

For basic details of the functions available the user is referred to pilpxi documentation.

Need help?


Search our knowledgebase for information on software drivers, product comparisons and technical support for our entire product range.


Product Selector

Because we offer such a large range of products, this tool will help you narrow down our offering to get you the correct switch and simulation solution you need.

Try the selector

Resource center

From success stories and product videos to product literature and newsletters, find the information you need about our switching and simulation solutions.

Get the resources you need

Worldwide presence

We supply and support our products across the globe, with seven offices in the Americas, Europe and Asia as well as additional representation. 

Find a local office or agent near you

Pickering are maintaining all operations throughout this difficult period. We are prepared to make sure we can continue to support your applications without delay and with outstanding service. See our full statement here .