LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

NI-DAQmx 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 "NIDAQmxBase.h"
#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 3
(2,289 Views)

Hello.

To begin, you have an alone  " #include " command 😉

Corresponding to the error message, the application doesn't  find your header. You need to specify the folder in development environnement or to attach the header to your project.

Hope this helps.


Manuel R
AE dans une autre vie
0 Kudos
Message 2 of 3
(2,271 Views)
Is your problem solved? 🙂
Manuel R
AE dans une autre vie
0 Kudos
Message 3 of 3
(2,262 Views)