05-22-2008 03:21 AM
05-28-2008 02:55 AM
Hi Michael,
when you use a other card like the usb 6210 then it works with daqmx driver and not with trad. daq driver as your old card.
Therefore you must program new. But daqmx programming is simpler than trad. daq programming.
Examples for that you find on C:\Programme\National Instruments\NI-DAQ\Examples when you have installed daqmx driver from CD you get to the usb device.
Attached it here in *.zip - here also an example in C - analog for PASCAL with own syntax
#include <stdlib.h>
#include <cvirte.h>
#include <userint.h>
#include <math.h>
#include <NIDAQmx.h>
#include <DAQmxIOctrl.h>
#include "ContAcq-IntClk.h"
......
DAQmxErrChk (DAQmxCreateTask("",&gTaskHandle));
DAQmxErrChk (DAQmxCreateAIVoltageChan(gTaskHandle,chan,"",DAQmx_Val_Cfg_Default,min,max,DAQmx_Val_Volts,NULL));
DAQmxErrChk (DAQmxCfgSampClkTiming(gTaskHandle,"",rate,DAQmx_Val_Rising,DAQmx_Val_ContSamps,sampsPerChan));
DAQmxErrChk (DAQmxGetTaskAttribute(gTaskHandle,DAQmx_Task_NumChans,&gNumChannels));
if( (gData=(float64*)malloc(sampsPerChan*gNumChannels*sizeof(float64)))==NULL ) {
MessagePopup("Error","Not enough memory");
goto Error;
}
DAQmxErrChk (DAQmxRegisterEveryNSamplesEvent(gTaskHandle,DAQmx_Val_Acquired_Into_Buffer,sampsPerChan,0,EveryNCallback,NULL));
DAQmxErrChk (DAQmxRegisterDoneEvent(gTaskHandle,0,DoneCallback,NULL));
/*********************************************/
// DAQmx Start Code
/*********************************************/
DAQmxErrChk (DAQmxStartTask(gTaskHandle));
....
DAQmxErrChk (DAQmxReadAnalogF64(taskHandle,nSamples,10.0,DAQmx_Val_GroupByScanNumber,gData,nSamples*gNumChannels,&numRead,NULL));
if( numRead>0 )
PlotStripChart(panelHandle,PANEL_STRIPCHART,gData,numRead*gNumChannels,0,0,VAL_DOUBLE);
....
DAQmxStopTask(taskHandle);
DAQmxClearTask(taskHandle);
...
Hope this helps
Best Regards
Johann
05-28-2008 02:56 AM