ValueError: Procedure probably called with not enough arguments (8bytes missing)

Discussion in 'Python' started by LabJack Support, Aug 7, 2009.

  1. Hello! I am chasing around a problem that I am having with ctypes and
    I am hoping someone can help out. Here is the Python code:

    def asynch(self, baudrate, data, idNum=None, demo=0, portB=0,
    enableTE=0, enableTO=0, enableDel=0, numWrite=0, numRead=0):
    """
    Name: U12.asynchConfig(fullA, fullB, fullC, halfA, halfB,
    halfC, idNum=None, demo=None, timeoutMult=1, configA=0, configB=0,
    configTE=0)
    Args: See section 4.12 of the User's Guide
    Desc: Requires firmware V1.1 or higher. This function writes
    to the asynch registers and sets the direction of the D lines (input/
    output) as needed.

    >>> dev = U12()
    >>> dev.asynchConfig(96,1,1,22,2,1)
    >>> {'idNum': 1}

    """

    #Check id number
    if idNum is None:
    idNum = self.id
    idNum = ctypes.c_long(idNum)

    # Check size of data
    if len(data) > 18: raise ValueError("data can not be larger
    than 18 elements")

    # Make data 18 elements large
    dataArray = [0] * 18
    for i in range(0, len(data)):
    dataArray = data
    print dataArray
    dataArray = listToCArray(dataArray, ctypes.c_long)

    ecode = staticLib.AsynchConfig(ctypes.byref(idNum), demo,
    portB, enableTE, enableTO, enableDel, baudrate, numWrite, numRead,
    ctypes.byref(dataArray))

    if ecode != 0:print ecode # TODO: Switch this out for
    exception

    return {"idnum":long, "data":dataArray}

    Here is the method signature of the c function:

    long Asynch( long *idnum,
    long demo,
    long portB,
    long enableTE,
    long enableTO,
    long enableDel,
    long baudrate,
    long numWrite,
    long numRead,
    long *data)

    Thank you in advance,
    Sam
     
    LabJack Support, Aug 7, 2009
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Auronc
    Replies:
    3
    Views:
    306
    Auronc
    Sep 9, 2004
  2. Mike P
    Replies:
    0
    Views:
    3,310
    Mike P
    Jun 19, 2006
  3. Kevin Walzer

    Not enough arguments for format string

    Kevin Walzer, Nov 14, 2005, in forum: Python
    Replies:
    2
    Views:
    11,037
    James
    Nov 14, 2005
  4. LabJack Support
    Replies:
    0
    Views:
    369
    LabJack Support
    Aug 7, 2009
  5. Isaac Won
    Replies:
    0
    Views:
    212
    Isaac Won
    Feb 6, 2013
Loading...

Share This Page