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

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

  1. On Aug 7, 4:16 pm, LabJack Support <> wrote:
    > 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


    Whoops I am sorry. The problem was due to a typo.
    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. Mike P
    Replies:
    0
    Views:
    3,284
    Mike P
    Jun 19, 2006
  2. Kevin Walzer

    Not enough arguments for format string

    Kevin Walzer, Nov 14, 2005, in forum: Python
    Replies:
    2
    Views:
    11,012
    James
    Nov 14, 2005
  3. ronrsr
    Replies:
    3
    Views:
    483
    ronrsr
    Nov 20, 2006
  4. LabJack Support
    Replies:
    0
    Views:
    498
    LabJack Support
    Aug 7, 2009
  5. Isaac Won
    Replies:
    0
    Views:
    201
    Isaac Won
    Feb 6, 2013
Loading...

Share This Page