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

  • Thread starter LabJack Support
  • Start date
L

LabJack Support

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.
"""

#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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,567
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top