03-22-2018 07:02 AM
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....
03-29-2018 07:53 AM
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