Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

change DAQ ->DAQmx and from MIO-16E -> USB 6210

Hello,
 
we have a self-written programm (in Pascal) and use it to read the AIs from the AT-MIO-16E-10 and transfer the Datas into Excel. Now we want to replace the MIO with a NI-USB 6210. The Programm should have the same function as now.
The question: is there a simple way to do this (without changing the sourcecode) or is there a tutorium for the swich to the mx driver?
 
Regards  Michael
0 Kudos
Message 1 of 3
(3,806 Views)

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

0 Kudos
Message 2 of 3
(3,780 Views)
The second part for transfering datas to Excel should be then the same as in your old programm
0 Kudos
Message 3 of 3
(3,779 Views)