Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

Is the number of lines limited when using change detection and PCI-6509 card

Hi!

 

I'm making C++ application which should read data at least from 56 lines. For now, I use SIMULATED PCI-6509 device.

 

Device will send back data up to 32 lines, but after that it send only zero values. It doesn't matter which lines I use, only how many. Does anybody know if the problem is in simulation program, in my code or other?

 

Test enviroment:

Vista 64 SP1, Visual studio 2008, NI-DAQmx 8.9

 

For simplicity I tested this problem with NI example code and got same result:

 

#include <stdio.h>

#include <NIDAQmx.h>

#define DAQmxErrChk(functionCall) if( DAQmxFailed(error=(functionCall)) ) goto Error; elseint main(void)

{

int32 error=0;

TaskHandle taskHandle=0;

uInt8 data[224];

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

int32 numRead;

int32 bytesPerSamp;

/*********************************************/

// DAQmx Configure Code

/*********************************************/

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

DAQmxErrChk (DAQmxCreateDIChan(taskHandle,"Dev1/line0:55","",DAQmx_Val_ChanPerLine));DAQmxErrChk (DAQmxCfgChangeDetectionTiming(taskHandle,

"Dev1/line0:55","Dev1/line0:55",DAQmx_Val_ContSamps,4));

/*********************************************/

// DAQmx Start Code

/*********************************************/

DAQmxErrChk (DAQmxStartTask(taskHandle));

printf(
"Continuously reading. Press Ctrl+C to interrupt\n");

while( 1 )

/*********************************************/

// DAQmx Read Code

/*********************************************/

DAQmxErrChk (DAQmxReadDigitalLines (taskHandle,4,10.0,DAQmx_Val_GroupByScanNumber,data,224,&numRead,&bytesPerSamp,NULL));

Error:

if( DAQmxFailed(error) )

DAQmxGetExtendedErrorInfo(errBuff,2048);

if( taskHandle!=0 ) {

/*********************************************/

// DAQmx Stop Code

/*********************************************/

DAQmxStopTask(taskHandle);

DAQmxClearTask(taskHandle);

}

if( DAQmxFailed(error) )

printf("DAQmx Error: %s\n",errBuff);printf(

"End of program, press Enter key to quit\n");

getchar();

return 0;

}

0 Kudos
Message 1 of 1
(3,405 Views)