Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

NI-USB 6008 Mac OSX

I tried to use the example acquire1Scan.c to acquire a simple voltage on my 6008. It returns the following message: ZeroLink: unknown symbol '_DAQmxBaseCreateTask'
The NIDAQmxBase.h is located in the "Other Sources" folder.
I should forget something...
Thank you for your help.

Daniel Jean

#include
#include

#define DAQmxErrChk(functionCall) { if( DAQmxFailed(error=(functionCall)) ) { goto Error; } }

int main(int argc, char *argv[])
{
// Task parameters
int32 error = 0;
TaskHandle taskHandle = 0;
char errBuff[2048]={'\0'};

// Channel parameters
char chan[] = "Dev1/ai0";
float64 min = -10.0;
float64 max = 10.0;

// Timing parameters
uInt64 samplesPerChan = 1;

// Data read parameters
float64 data;
int32 pointsToRead = 10;
int32 pointsRead;
float64 timeout = 10.0;


DAQmxErrChk (DAQmxBaseCreateTask("",&taskHandle));
DAQmxErrChk (DAQmxBaseCreateAIVoltageChan(taskHandle,chan,"",DAQmx_Val_Cfg_Default,min,max,DAQmx_Val_Volts,NULL));
DAQmxErrChk (DAQmxBaseStartTask(taskHandle));
DAQmxErrChk (DAQmxBaseReadAnalogF64(taskHandle,pointsToRead,timeout,DAQmx_Val_GroupByChannel,&data,samplesPerChan,&pointsRead,NULL));

printf ("Acquired reading: %f\n", data);

Error:
if( DAQmxFailed(error) )
DAQmxBaseGetExtendedErrorInfo(errBuff,2048);
if( taskHandle!=0 ) {
DAQmxBaseStopTask(taskHandle);
DAQmxBaseClearTask(taskHandle);
}
if( DAQmxFailed(error) )
printf("DAQmxBase Error: %s\n",errBuff);

return 0;
}
0 Kudos
Message 1 of 2
(2,910 Views)

Hi Daniel,

 

I see that you don't have any answer to your post for the moment. I hope that you have found a solution to your issue. If you still have this issue, I suggest you to verify that your library is well linked. I don't particularly know Mac OS X, but I know this kind of error. It means that the declaration of the function is founded (you have included the “NIDAQmxBase.h” header file) but the definition (or code) of the function is not found.

 

If you link your library statically, be sure that it is included in your project. If you load your library dynamically, please verify that your code to load the library is functional.

 

Best regards,

0 Kudos
Message 2 of 2
(2,838 Views)