You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm currently using the function DAQmxGetDeviceAttribute to obtain device attribute. It works fine with python 64bits (anaconda package) but it doesn't work with python 32bits (under windows 7 64bits or windows xp 32bits) :
some examples
fromPyDAQmximport*dev='Dev1'rate=(ctypes.c_double*1)()
#maximum input rate for all channelsDAQmxGetDeviceAttribute(dev,DAQmx_Dev_AI_MaxSingleChanRate,byref(rate))
fromPyDAQmximport*dev='Dev1'chans=ctypes.create_string_buffer('',1024)
#obtain the analog input channel nameDAQmxGetDeviceAttribute(dev,DAQmx_Dev_AI_PhysicalChans,chans)
If I correctly understand this error, it seems that the "address" of arguments are sent using a 64bits value in place of 32bits values (3x4bytes/32bits in excess). I don't know if this error can be avoided by calling these functions with other parameters or corrections have to be made in the pydaqmx package or another one ?
I have a similar error when using DAQmxGetSystemInfoAttribute (8 bytes in excess) e.g.
Let us notice that the acquisition functions work fine. When I look at the protype of these 2 functions (in NIDAQmx.h), I remark that they are variadic functions ... Maybe it explains the origin of the error ...
Could you please have a look in this and tell me if I'm doing something wrong or is it a problem with a package ?
I thank you in advance,
Kind regards,
Rudy
edit : some further tests seem to focus the problem when using windll to run these functions with python 32bits BUT the acquisitions (class Task) do not work anymore if I replace windll by cdll in the DAQmxFunctions.py when using python 32bits (ValueError: Procedure called with not enough arguments (8 bytes missing) or wrong calling convention) No problem using python 64bits in both case (windll or cdll).
This example code works fine with python 64bits & python 32bits in windows 7 64bits (not yet tested with windows xp) :
I arrived to the same conclusion. By using the cdll calling convention it works (on windows XP 32bits). But of course everything else is no longer working.
I have created a new branch (called variadic_function) which I think could solve the problem. I did not test it (and can only do it on Win XP). Can you test it on the different platforms you are using.
Thank you very much for your reply, your tests, your patch and even more for your nidaqmx python wrapper :-)
I tried the new branch on windows xp 32bits & windows 7 64bits (python x32 & x64) and it seems to work fine now with all functions !
By the way, meanwhile, I found in the nidaqmx header that there is a function (not variadic) for every call of DAQmxGetAttribute. So, I replaced them with their equivalents (e.g. DAQmxGetDevAIMaxSingleChanRate ) which works everywhere by default with your master branch. The nidaqmx library documentation is really poor ...
If you need other tests or information, don't hesitate to contact me !
Hello,
I'm currently using the function DAQmxGetDeviceAttribute to obtain device attribute. It works fine with python 64bits (anaconda package) but it doesn't work with python 32bits (under windows 7 64bits or windows xp 32bits) :
some examples
I have the same errors :
If I correctly understand this error, it seems that the "address" of arguments are sent using a 64bits value in place of 32bits values (3x4bytes/32bits in excess). I don't know if this error can be avoided by calling these functions with other parameters or corrections have to be made in the pydaqmx package or another one ?
I have a similar error when using DAQmxGetSystemInfoAttribute (8 bytes in excess) e.g.
Let us notice that the acquisition functions work fine. When I look at the protype of these 2 functions (in NIDAQmx.h), I remark that they are variadic functions ... Maybe it explains the origin of the error ...
Could you please have a look in this and tell me if I'm doing something wrong or is it a problem with a package ?
I thank you in advance,
Kind regards,
Rudy
edit : some further tests seem to focus the problem when using windll to run these functions with python 32bits BUT the acquisitions (class Task) do not work anymore if I replace windll by cdll in the DAQmxFunctions.py when using python 32bits (ValueError: Procedure called with not enough arguments (8 bytes missing) or wrong calling convention) No problem using python 64bits in both case (windll or cdll).
This example code works fine with python 64bits & python 32bits in windows 7 64bits (not yet tested with windows xp) :
The text was updated successfully, but these errors were encountered: