Accessing Pickering LXI driver using Python

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

    The Pickering LXI driver has a capability to run with PCI, PXI and LXI cards.

    Download the Python library for LXI Driver from the Here

    Import the Library using the following command

    from pilxi import*

    Python Library for LXI Driver

    The Python Library comprises of set of functions defined in two main classes:

    1. PI_BASE : This class contains non card-specific functions to locate PXI cards

    2. PI_CARD: This class contains all the card specific functions to access and control Pickering PXI cards.

    An Example program can be executed which connects/open card(s) and and list its ID, Number of Sub Units and Sub types.

    from pilxi import *
    base = pi_base(0,"",1024,1000)
    e, count = base.CountFreeCards()
    e, bus, slot = base.FindFreeCards(count)
    print "--------------------------------"
    cardnum = 0
    while cardnum < count:
        card = pi_card(0,"",1024,1000,bus[cardnum],slot[cardnum])
        err, cid = card.CardId()
        print "\nCard ",cardnum+1,
        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
        print "\n--------------------------------"
        cardnum = cardnum +1

    If a connecting to PCI card or PXI chassis, use the string "PXI" instead of an IP address when entering the input arguments for the two classes.

    base = pi_base(0,"PXI",1024,1000)
    card = pi_card(0,"PXI",1024,1000,bus[cardnum],slot[card])

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

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

    The Output will be

    >>> ================================ RESTART ================================
    Card  1 Bus 1  Device 10
    ID =  40-542-021,0,1.00
    subunits:  0 input,  1 output
    subunit  1  =  MATRIX(33X16)
    Card  2 Bus 1  Device 12
    ID =  40-736-001,300337,1.00
    subunits:  0 input,  5 output
    subunit  1  =  SWITCH(14)
    subunit  2  =  MUX(8)
    subunit  3  =  MUX(8)
    subunit  4  =  MUX(8)
    subunit  5  =  MUX(8)

    For basic details of the other functions available the user can refer to picmlx and piplx documentation.

    Need Help´╝č


    Information on software drivers, product comparisons and technical support for our entire product range.


    Product Selector

    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

    Success storiesproduct videos and more—find the information you need about our switching and simulation.

    Resources you need

    Worldwide presence

    Find support across the globe, with offices and agents in the Americas, Europe and Asia. 

    Find local office or agent