Academic Hardware Products (myDAQ, myRIO)

cancel
Showing results for 
Search instead for 
Did you mean: 

USB-6363 C code

Hello,

 

i would like to use the digital outputs of my USB 6363. For that i need libarys in C... This is my example code:

#include <NIDAQmx.h>
#include <nisyscfg.h>
#include <nisyscfg_errors.h>
#include <nisyscfg_pxi.h>
#include <nisyscfg_wide.h>

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

int main(void)

{

int32 error=0;

TaskHandle taskHandle=0;

int32 read;

float64 data[1000];

char errBuff[2048]={'\0'};

// DAQmx analog voltage channel and timing parameters

DAQmxErrChk (DAQmxCreateTask("", &taskHandle));

DAQmxErrChk(DAQmxCreateAIVoltageChan(taskHandle, "Dev1/ai0", "", DAQmx_Val_Cfg_Default, -10.0, 10.0, DAQmx_Val_Volts, NULL));

DAQmxErrChk(DAQmxCfgSampClkTiming(taskHandle, "", 10000.0, DAQmx_Val_Rising, DAQmx_Val_FiniteSamps, 1000));

.........

 

 

Error:

undefined reference to `DAQmxGetExtendedErrorInfo@8'
C:\Users\EMA\Documents\Test.o:Test.c:(.text+0x1b5): undefined reference to `DAQmxStopTask@4'
C:\Users\EMA\Documents\Test.o:Test.c:(.text+0x1c3): undefined reference to `DAQmxClearTask@4'

 

I do not know why this references are undefined....

 

0 Kudos
Message 1 of 2
(2,965 Views)

Hi Michael,

 

I recommend you use the DAQmx Ansi C sample code to get started with digital output. You can find it by browsing to:

C:\Users\Public\Documents\National Instruments\NI-DAQ\Examples\DAQmx ANSI C\Digital\Generate Values\Write Dig Chan

 

kind regards

 

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