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,"192.168.1.200",1024,1000)
     
    e, count = base.CountFreeCards()
    e, bus, slot = base.FindFreeCards(count)
     
    print "--------------------------------"
     
    cardnum = 0
    while cardnum < count:
     
        card = pi_card(0,"192.168.1.200",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?



    Support knowledgebase

    Have questions or need some help? While we enjoy talking to you, you can find technical information for our entire product range here.

    Technical know-how 


    Long-term support

    Because we manufacture our products in-house, we are able to provide you with guaranteed long-term support and low obsolescence.

    Our support


    Resource center

    From success stories and product literature to 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