Paul-Quentin,
First of all, thank you for your interest in PyRWI. Please post your questions to the mailing list (
http://groups.google.com/group/pyrwi-devel/ ) so that others can benefit from them.
I am using NI-DAQmx 8.9.5. For me, CalHandle is defined as
typedef uInt32 CalHandle;
in the NIDAQmx.h header file.
I would recommend
- Make sure you have the NIDAQmx.h header file. My header file was installed here: C:\Program Files\National Instruments\NI-DAQ\DAQmx ANSI C Dev\include
- If you do not have the header file, you need to go back to the NIDAQmx installer and make sure you include the ANSI C option.
- If you do have the header file, but it is not installed in the same location, you will have to modify the build.sh to point to the correct path.
- Look in your NIDAQmx.h header file and see if it defines CalHandle.
- If it does not, then you need to figure out what it is using instead. You can do this by looking up a function like DAQmxESeriesCalAdjust. My header file defines this function as follows:
int32 __CFUNC DAQmxESeriesCalAdjust (CalHandle calHandle, float64 referenceVoltage);
If yours has a different definition, then the nidaqmx.i file needs to be rebuilt. See instructions below.
Re-building nidaqmx.i:
- Update to the latest code from the repository. You should now have the genInterface.py script.
- If your NIDAQmx.h is in a different location than mine, you may have to edit the genInterface.py code to adjust the default header path. ( self.header_path = "C:\Program Files..." )
- Run genInterface.py. It should re-write your nidaqmx.i file.
- Double check the DAQmxESeriesCalAdjust definition in nidaqmx.i and see if it matches the definition in your header file.
- Now try running build.sh now
Hope that helps. If not let me know.
BTW right now I only have time to work on PyRWI on the weekends, so I am sorry for the long delay in my responses.
Daniel
On Fri, Oct 23, 2009 at 12:31 PM, Paul-Quentin Elias
<*******> wrote:
Hello Daniel,
I found your code (PyRWI and nidaq module especially) and I must admit this is exactly what I was looking for. So I tried to compile your modules, but I am running into some C-code dark corners ; as you will notice, I am not very familiar with C ;o)
I did compile the static library libnidaqmx.a, but when I try to build the module, gcc blurts a bunch of error messages (listed below), which make me think that there is an issue with a CalHandle type definition (which is, I'm sad to say, the most accurate description of the problem I can figure out, even after a few hours spent scratching my head). This error appears in all the C function related to a Ni board calibration action.
I'v listed a few infos below and the listing. Perhaps will you be able, if you scan quickly throug the error listing, to figure out that something is missing. I use nidaq 7.5.0. I don't know if you're using another version...
Thanks
Best Regards,
Paul-Quentin
Sys info:
NI-DAQ 750
WinXP
python2.6.3
COMPILE Listing
$ ./build.sh
Call SWIG
Compile
nidaqmx_wrap.c: In function `_wrap_CreatePolynomialScale':
nidaqmx_wrap.c:10587: warning: passing arg 2 of `DAQmxCreatePolynomialScale' discards qualifiers from pointer target type
nidaqmx_wrap.c:10587: warning: passing arg 4 of `DAQmxCreatePolynomialScale' discards qualifiers from pointer target type
nidaqmx_wrap.c: In function `_wrap_CreateTableScale':
nidaqmx_wrap.c:10674: warning: passing arg 2 of `DAQmxCreateTableScale' discards qualifiers from pointer target type
nidaqmx_wrap.c:10674: warning: passing arg 4 of `DAQmxCreateTableScale' discards qualifiers from pointer target type
nidaqmx_wrap.c: In function `_wrap_CalculateReversePolyCoeff':
nidaqmx_wrap.c:10759: warning: passing arg 1 of `DAQmxCalculateReversePolyCoeff' discards qualifiers from pointer target type
nidaqmx_wrap.c: In function `_wrap_ESeriesCalAdjust':
nidaqmx_wrap.c:13319: error: `CalHandle' undeclared (first use in this function)
nidaqmx_wrap.c:13319: error: (Each undeclared identifier is reported only once
nidaqmx_wrap.c:13319: error: for each function it appears in.)
nidaqmx_wrap.c:13319: error: syntax error before "arg1"
nidaqmx_wrap.c:13334: error: `arg1' undeclared (first use in this function)
nidaqmx_wrap.c: In function `_wrap_MSeriesCalAdjust':
nidaqmx_wrap.c:13355: error: `CalHandle' undeclared (first use in this function)
nidaqmx_wrap.c:13355: error: syntax error before "arg1"
nidaqmx_wrap.c:13370: error: `arg1' undeclared (first use in this function)
nidaqmx_wrap.c: In function `_wrap_SSeriesCalAdjust':
nidaqmx_wrap.c:13391: error: `CalHandle' undeclared (first use in this function)
nidaqmx_wrap.c:13391: error: syntax error before "arg1"
nidaqmx_wrap.c:13406: error: `arg1' undeclared (first use in this function)
nidaqmx_wrap.c: In function `_wrap_SCBaseboardCalAdjust':
nidaqmx_wrap.c:13427: error: `CalHandle' undeclared (first use in this function)
nidaqmx_wrap.c:13427: error: syntax error before "arg1"
nidaqmx_wrap.c:13442: error: `arg1' undeclared (first use in this function)
nidaqmx_wrap.c: In function `_wrap_AOSeriesCalAdjust':
nidaqmx_wrap.c:13463: error: `CalHandle' undeclared (first use in this function)
nidaqmx_wrap.c:13463: error: syntax error before "arg1"
nidaqmx_wrap.c:13478: error: `arg1' undeclared (first use in this function)
nidaqmx_wrap.c: In function `_wrap_InitExtCal':
nidaqmx_wrap.c:13655: error: `CalHandle' undeclared (first use in this function)
nidaqmx_wrap.c:13655: error: `arg3' undeclared (first use in this function)
nidaqmx_wrap.c:13655: error: syntax error before ')' token
nidaqmx_wrap.c:13684: error: syntax error before ')' token
nidaqmx_wrap.c: In function `_wrap_CloseExtCal':
nidaqmx_wrap.c:13704: error: `CalHandle' undeclared (first use in this function)
nidaqmx_wrap.c:13704: error: syntax error before "arg1"
nidaqmx_wrap.c:13719: error: `arg1' undeclared (first use in this function)
nidaqmx_wrap.c: In function `_wrap_AdjustDSAAICal':
nidaqmx_wrap.c:13794: error: `CalHandle' undeclared (first use in this function)
nidaqmx_wrap.c:13794: error: syntax error before "arg1"
nidaqmx_wrap.c:13809: error: `arg1' undeclared (first use in this function)
nidaqmx_wrap.c: In function `_wrap_AdjustDSAAICalEx':
nidaqmx_wrap.c:13830: error: `CalHandle' undeclared (first use in this function)
nidaqmx_wrap.c:13830: error: syntax error before "arg1"
nidaqmx_wrap.c:13849: error: `arg1' undeclared (first use in this function)
nidaqmx_wrap.c: In function `_wrap_AdjustDSAAOCal':
nidaqmx_wrap.c:13875: error: `CalHandle' undeclared (first use in this function)
nidaqmx_wrap.c:13875: error: syntax error before "arg1"
nidaqmx_wrap.c:13910: error: `arg1' undeclared (first use in this function)
nidaqmx_wrap.c: In function `_wrap_AdjustDSATimebaseCal':
nidaqmx_wrap.c:13956: error: `CalHandle' undeclared (first use in this function)
nidaqmx_wrap.c:13956: error: syntax error before "arg1"
nidaqmx_wrap.c:13971: error: `arg1' undeclared (first use in this function)
nidaqmx_wrap.c: In function `_wrap_Adjust4204Cal':
nidaqmx_wrap.c:13992: error: `CalHandle' undeclared (first use in this function)
nidaqmx_wrap.c:13992: error: syntax error before "arg1"
nidaqmx_wrap.c:14020: error: `arg1' undeclared (first use in this function)
nidaqmx_wrap.c: In function `_wrap_Adjust4220Cal':
nidaqmx_wrap.c:14058: error: `CalHandle' undeclared (first use in this function)
nidaqmx_wrap.c:14058: error: syntax error before "arg1"
nidaqmx_wrap.c:14082: error: `arg1' undeclared (first use in this function)
nidaqmx_wrap.c: In function `_wrap_Adjust4224Cal':
nidaqmx_wrap.c:14115: error: `CalHandle' undeclared (first use in this function)
nidaqmx_wrap.c:14115: error: syntax error before "arg1"
nidaqmx_wrap.c:14139: error: `arg1' undeclared (first use in this function)
nidaqmx_wrap.c: In function `_wrap_Adjust4225Cal':
nidaqmx_wrap.c:14172: error: `CalHandle' undeclared (first use in this function)
nidaqmx_wrap.c:14172: error: syntax error before "arg1"
nidaqmx_wrap.c:14196: error: `arg1' undeclared (first use in this function)
nidaqmx_wrap.c: In function `_wrap_Setup1102Cal':
nidaqmx_wrap.c:14229: error: `CalHandle' undeclared (first use in this function)
nidaqmx_wrap.c:14229: error: syntax error before "arg1"
nidaqmx_wrap.c:14249: error: `arg1' undeclared (first use in this function)
nidaqmx_wrap.c: In function `_wrap_Adjust1102Cal':
nidaqmx_wrap.c:14277: error: `CalHandle' undeclared (first use in this function)
nidaqmx_wrap.c:14277: error: syntax error before "arg1"
nidaqmx_wrap.c:14296: error: `arg1' undeclared (first use in this function)
nidaqmx_wrap.c: In function `_wrap_Setup1104Cal':
nidaqmx_wrap.c:14322: error: `CalHandle' undeclared (first use in this function)
nidaqmx_wrap.c:14322: error: syntax error before "arg1"
nidaqmx_wrap.c:14338: error: `arg1' undeclared (first use in this function)
nidaqmx_wrap.c: In function `_wrap_Adjust1104Cal':
nidaqmx_wrap.c:14361: error: `CalHandle' undeclared (first use in this function)
nidaqmx_wrap.c:14361: error: syntax error before "arg1"
nidaqmx_wrap.c:14380: error: `arg1' undeclared (first use in this function)
nidaqmx_wrap.c: In function `_wrap_Setup1112Cal':
nidaqmx_wrap.c:14406: error: `CalHandle' undeclared (first use in this function)
nidaqmx_wrap.c:14406: error: syntax error before "arg1"
nidaqmx_wrap.c:14422: error: `arg1' undeclared (first use in this function)
nidaqmx_wrap.c: In function `_wrap_Adjust1112Cal':
nidaqmx_wrap.c:14445: error: `CalHandle' undeclared (first use in this function)
nidaqmx_wrap.c:14445: error: syntax error before "arg1"
nidaqmx_wrap.c:14464: error: `arg1' undeclared (first use in this function)
nidaqmx_wrap.c: In function `_wrap_Setup1122Cal':
nidaqmx_wrap.c:14490: error: `CalHandle' undeclared (first use in this function)
nidaqmx_wrap.c:14490: error: syntax error before "arg1"
nidaqmx_wrap.c:14510: error: `arg1' undeclared (first use in this function)
nidaqmx_wrap.c: In function `_wrap_Adjust1122Cal':
nidaqmx_wrap.c:14538: error: `CalHandle' undeclared (first use in this function)
nidaqmx_wrap.c:14538: error: syntax error before "arg1"
nidaqmx_wrap.c:14557: error: `arg1' undeclared (first use in this function)
nidaqmx_wrap.c: In function `_wrap_Setup1124Cal':
nidaqmx_wrap.c:14583: error: `CalHandle' undeclared (first use in this function)
nidaqmx_wrap.c:14583: error: syntax error before "arg1"
nidaqmx_wrap.c:14607: error: `arg1' undeclared (first use in this function)
nidaqmx_wrap.c: In function `_wrap_Adjust1124Cal':
nidaqmx_wrap.c:14640: error: `CalHandle' undeclared (first use in this function)
nidaqmx_wrap.c:14640: error: syntax error before "arg1"
nidaqmx_wrap.c:14655: error: `arg1' undeclared (first use in this function)
nidaqmx_wrap.c: In function `_wrap_Setup1125Cal':
nidaqmx_wrap.c:14676: error: `CalHandle' undeclared (first use in this function)
nidaqmx_wrap.c:14676: error: syntax error before "arg1"
nidaqmx_wrap.c:14696: error: `arg1' undeclared (first use in this function)
nidaqmx_wrap.c: In function `_wrap_Adjust1125Cal':
nidaqmx_wrap.c:14724: error: `CalHandle' undeclared (first use in this function)
nidaqmx_wrap.c:14724: error: syntax error before "arg1"
nidaqmx_wrap.c:14743: error: `arg1' undeclared (first use in this function)
nidaqmx_wrap.c: In function `_wrap_Setup1126Cal':
nidaqmx_wrap.c:14769: error: `CalHandle' undeclared (first use in this function)
nidaqmx_wrap.c:14769: error: syntax error before "arg1"
nidaqmx_wrap.c:14789: error: `arg1' undeclared (first use in this function)
nidaqmx_wrap.c: In function `_wrap_Adjust1126Cal':
nidaqmx_wrap.c:14817: error: `CalHandle' undeclared (first use in this function)
nidaqmx_wrap.c:14817: error: syntax error before "arg1"
nidaqmx_wrap.c:14836: error: `arg1' undeclared (first use in this function)
nidaqmx_wrap.c: In function `_wrap_Setup1141Cal':
nidaqmx_wrap.c:14862: error: `CalHandle' undeclared (first use in this function)
nidaqmx_wrap.c:14862: error: syntax error before "arg1"
nidaqmx_wrap.c:14882: error: `arg1' undeclared (first use in this function)
nidaqmx_wrap.c: In function `_wrap_Adjust1141Cal':
nidaqmx_wrap.c:14910: error: `CalHandle' undeclared (first use in this function)
nidaqmx_wrap.c:14910: error: syntax error before "arg1"
nidaqmx_wrap.c:14929: error: `arg1' undeclared (first use in this function)
nidaqmx_wrap.c: In function `_wrap_Setup1142Cal':
nidaqmx_wrap.c:14955: error: `CalHandle' undeclared (first use in this function)
nidaqmx_wrap.c:14955: error: syntax error before "arg1"
nidaqmx_wrap.c:14975: error: `arg1' undeclared (first use in this function)
nidaqmx_wrap.c: In function `_wrap_Adjust1142Cal':
nidaqmx_wrap.c:15003: error: `CalHandle' undeclared (first use in this function)
nidaqmx_wrap.c:15003: error: syntax error before "arg1"
nidaqmx_wrap.c:15022: error: `arg1' undeclared (first use in this function)
nidaqmx_wrap.c: In function `_wrap_Setup1143Cal':
nidaqmx_wrap.c:15048: error: `CalHandle' undeclared (first use in this function)
nidaqmx_wrap.c:15048: error: syntax error before "arg1"
nidaqmx_wrap.c:15068: error: `arg1' undeclared (first use in this function)
nidaqmx_wrap.c: In function `_wrap_Adjust1143Cal':
nidaqmx_wrap.c:15096: error: `CalHandle' undeclared (first use in this function)
nidaqmx_wrap.c:15096: error: syntax error before "arg1"
nidaqmx_wrap.c:15115: error: `arg1' undeclared (first use in this function)
nidaqmx_wrap.c: In function `_wrap_Setup1502Cal':
nidaqmx_wrap.c:15141: error: `CalHandle' undeclared (first use in this function)
nidaqmx_wrap.c:15141: error: syntax error before "arg1"
nidaqmx_wrap.c:15161: error: `arg1' undeclared (first use in this function)
nidaqmx_wrap.c: In function `_wrap_Adjust1502Cal':
nidaqmx_wrap.c:15189: error: `CalHandle' undeclared (first use in this function)
nidaqmx_wrap.c:15189: error: syntax error before "arg1"
nidaqmx_wrap.c:15208: error: `arg1' undeclared (first use in this function)
nidaqmx_wrap.c: In function `_wrap_Setup1503Cal':
nidaqmx_wrap.c:15234: error: `CalHandle' undeclared (first use in this function)
nidaqmx_wrap.c:15234: error: syntax error before "arg1"
nidaqmx_wrap.c:15254: error: `arg1' undeclared (first use in this function)
nidaqmx_wrap.c: In function `_wrap_Adjust1503Cal':
nidaqmx_wrap.c:15282: error: `CalHandle' undeclared (first use in this function)
nidaqmx_wrap.c:15282: error: syntax error before "arg1"
nidaqmx_wrap.c:15301: error: `arg1' undeclared (first use in this function)
nidaqmx_wrap.c: In function `_wrap_Adjust1503CurrentCal':
nidaqmx_wrap.c:15327: error: `CalHandle' undeclared (first use in this function)
nidaqmx_wrap.c:15327: error: syntax error before "arg1"
nidaqmx_wrap.c:15347: error: `arg1' undeclared (first use in this function)
nidaqmx_wrap.c: In function `_wrap_Setup1520Cal':
nidaqmx_wrap.c:15375: error: `CalHandle' undeclared (first use in this function)
nidaqmx_wrap.c:15375: error: syntax error before "arg1"
nidaqmx_wrap.c:15395: error: `arg1' undeclared (first use in this function)
nidaqmx_wrap.c: In function `_wrap_Adjust1520Cal':
nidaqmx_wrap.c:15423: error: `CalHandle' undeclared (first use in this function)
nidaqmx_wrap.c:15423: error: syntax error before "arg1"
nidaqmx_wrap.c:15442: error: `arg1' undeclared (first use in this function)
nidaqmx_wrap.c: In function `_wrap_Setup1521Cal':
nidaqmx_wrap.c:15468: error: `CalHandle' undeclared (first use in this function)
nidaqmx_wrap.c:15468: error: syntax error before "arg1"
nidaqmx_wrap.c:15484: error: `arg1' undeclared (first use in this function)
nidaqmx_wrap.c: In function `_wrap_Adjust1521Cal':
nidaqmx_wrap.c:15507: error: `CalHandle' undeclared (first use in this function)
nidaqmx_wrap.c:15507: error: syntax error before "arg1"
nidaqmx_wrap.c:15526: error: `arg1' undeclared (first use in this function)
nidaqmx_wrap.c: In function `_wrap_Setup153xCal':
nidaqmx_wrap.c:15552: error: `CalHandle' undeclared (first use in this function)
nidaqmx_wrap.c:15552: error: syntax error before "arg1"
nidaqmx_wrap.c:15572: error: `arg1' undeclared (first use in this function)
nidaqmx_wrap.c: In function `_wrap_Adjust153xCal':
nidaqmx_wrap.c:15600: error: `CalHandle' undeclared (first use in this function)
nidaqmx_wrap.c:15600: error: syntax error before "arg1"
nidaqmx_wrap.c:15619: error: `arg1' undeclared (first use in this function)
nidaqmx_wrap.c: In function `_wrap_Setup1540Cal':
nidaqmx_wrap.c:15645: error: `CalHandle' undeclared (first use in this function)
nidaqmx_wrap.c:15645: error: syntax error before "arg1"
nidaqmx_wrap.c:15669: error: `arg1' undeclared (first use in this function)
nidaqmx_wrap.c: In function `_wrap_Adjust1540Cal':
nidaqmx_wrap.c:15702: error: `CalHandle' undeclared (first use in this function)
nidaqmx_wrap.c:15702: error: syntax error before "arg1"
nidaqmx_wrap.c:15725: error: `arg1' undeclared (first use in this function)
nidaqmx_wrap.c: In function `_wrap_WriteToTEDSFromArray':
nidaqmx_wrap.c:18476: warning: passing arg 2 of `DAQmxWriteToTEDSFromArray' discards qualifiers from pointer target type
nidaqmx_wrap.c: In function `_wrap_WriteAnalogF64':
nidaqmx_wrap.c:19853: warning: passing arg 6 of `DAQmxWriteAnalogF64' discards qualifiers from pointer target type
nidaqmx_wrap.c: In function `_wrap_WriteBinaryI16':
nidaqmx_wrap.c:20031: warning: passing arg 6 of `DAQmxWriteBinaryI16' discards qualifiers from pointer target type
nidaqmx_wrap.c: In function `_wrap_WriteBinaryU16':
nidaqmx_wrap.c:20141: warning: passing arg 6 of `DAQmxWriteBinaryU16' discards qualifiers from pointer target type
nidaqmx_wrap.c: In function `_wrap_WriteBinaryI32':
nidaqmx_wrap.c:20251: warning: passing arg 6 of `DAQmxWriteBinaryI32' discards qualifiers from pointer target type
nidaqmx_wrap.c: In function `_wrap_WriteBinaryU32':
nidaqmx_wrap.c:20361: warning: passing arg 6 of `DAQmxWriteBinaryU32' discards qualifiers from pointer target type
nidaqmx_wrap.c: In function `_wrap_WriteDigitalU8':
nidaqmx_wrap.c:20471: warning: passing arg 6 of `DAQmxWriteDigitalU8' discards qualifiers from pointer target type
nidaqmx_wrap.c: In function `_wrap_WriteDigitalU16':
nidaqmx_wrap.c:20581: warning: passing arg 6 of `DAQmxWriteDigitalU16' discards qualifiers from pointer target type
nidaqmx_wrap.c: In function `_wrap_WriteDigitalU32':
nidaqmx_wrap.c:20691: warning: passing arg 6 of `DAQmxWriteDigitalU32' discards qualifiers from pointer target type
nidaqmx_wrap.c: In function `_wrap_WriteDigitalLines':
nidaqmx_wrap.c:20869: warning: passing arg 6 of `DAQmxWriteDigitalLines' discards qualifiers from pointer target type
nidaqmx_wrap.c: In function `_wrap_WriteCtrFreq':
nidaqmx_wrap.c:20982: warning: passing arg 6 of `DAQmxWriteCtrFreq' discards qualifiers from pointer target type
nidaqmx_wrap.c:20982: warning: passing arg 7 of `DAQmxWriteCtrFreq' discards qualifiers from pointer target type
nidaqmx_wrap.c: In function `_wrap_WriteCtrTime':
nidaqmx_wrap.c:21163: warning: passing arg 6 of `DAQmxWriteCtrTime' discards qualifiers from pointer target type
nidaqmx_wrap.c:21163: warning: passing arg 7 of `DAQmxWriteCtrTime' discards qualifiers from pointer target type
nidaqmx_wrap.c: In function `_wrap_WriteCtrTicks':
nidaqmx_wrap.c:21344: warning: passing arg 6 of `DAQmxWriteCtrTicks' discards qualifiers from pointer target type
nidaqmx_wrap.c:21344: warning: passing arg 7 of `DAQmxWriteCtrTicks' discards qualifiers from pointer target type
nidaqmx_wrap.c: In function `_wrap_WriteRaw':
nidaqmx_wrap.c:21501: warning: passing arg 5 of `DAQmxWriteRaw' discards qualifiers from pointer target type
nidaqmx_wrap.c: In function `_wrap_GetWriteAttribute__varargs__':
nidaqmx_wrap.c:21548: error: too many arguments to function `DAQmxGetWriteAttribute'
elias@DMPH-C017 /d/temp/ni
$
--
___________________________
Paul-Quentin Elias
Département Mesures Physiques
ONERA
Chemin de la Hunière
FR-91761 PALAISEAU CEDEX
Tel +33 1 69 93 61 71
Fax +33 1 69 93 61 82
___________________________