02-16-2012 07:43 AM
Hi,
I try to use USB-6009 in Python 2.6 environment at Win7 64bit system and I'm facing issues with following command.
The following issues I see following error command
Thank you for help,
Solved! Go to Solution.
02-16-2012 04:54 PM
Hi Katerina
You could try replacing 'c_char_p' with 'create_string_buffer.' According to the Python reference library , "you should be careful, however, not to pass them (edit: c_char_p) to functions expecting pointers to mutable memory. If you need mutable memory blocks, ctypes has a create_string_buffer() function which creates these in various ways."
from ctypes import * dll = windll.LoadLibrary("c:\\windows\\system32\\nicaiu.dll") error_str = create_string_buffer(2048) # try this instead of c_char_p("") b_size=c_uint(2048) task_handle = c_uint(0) error = dll.DAQmxStartTask(task_handle) #this will result in an error try: dll.DAQmxGetExtendedErrorInfo(error_str, b_size) print error_str.value except: print "oops"
Let me know if this helps.
Regards,
Sunil
02-19-2012 12:59 AM
It works, Thanks a lot.