Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

DAQmxCfgChangeDetectionTiming with USB 6501

Hello,
I want to detect on a port the falling and rising edge with my USB 6501.
So I tried the example:
 

int32 error=0;

TaskHandle taskHandle=0;

uInt8 data[32];

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

int32 numRead;

int32 bytesPerSamp;

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

/*/ DAQmx Configure Code

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

DAQmxErrChk (DAQmxCreateTask(

"",&taskHandle));

DAQmxErrChk (DAQmxCreateDIChan(taskHandle,

"Dev1/port0/line0:7","",DAQmx_Val_ChanPerLine));

DAQmxErrChk (DAQmxCfgChangeDetectionTiming(taskHandle,

"Dev1/port0/line0:7","Dev1/port0/line0:7",DAQmx_Val_ContSamps,4));

But the last line gives me an error -200077...

Is this function available for my 6501? I found no document which tells me wqhat is possible with it?

Thank you.

0 Kudos
Message 1 of 5
(4,807 Views)

Hi Ien,

Which driver have you install ? 
You use labWindows/CVI, Visual C, or Visual Basic for programming this board.
I search an example thats working and i send to you later.
regards,
 

Christophe S.
Account Manager East of France І Certified LabVIEW Associate Developer І National Instruments France

0 Kudos
Message 2 of 5
(4,799 Views)

Thank you for your answer.

I use NIDAQmx 7.5 with Visual C++7.1.

The code I pasted is a part of the example given by NIDAQmx.

Even when I try with VI Logger, I have the same error (-200077).

So I think the USB 6501 is not compliant with DAQmxCfgChangeDetectionTiming function.

Can you confirm this?

Can you tell me which NIDAQmx functions I can use with the USB 6501?

Thank you.

0 Kudos
Message 3 of 5
(4,793 Views)

You have right Ms Ien, you can’t use timing function because USB-6501 hasn’t clock and timer.

 

You need use basic function, like :

 

DAQmxCreateTask

DAQmxCreateDIChan

DAQmxStartTask

DAQmxReadDigitalLines

DAQmxStopTask

DAQmxClearTask

 

And detect falling and rising edge with the software that you create.

 

You can found all function in your start menu :

ð      Start >>Programs>>National Instruments >> NI-DAQ >>NI-DAQmx C reference help

 

I join in this email two examples, try this into your PC.

Regards,

Christophe S.
Account Manager East of France І Certified LabVIEW Associate Developer І National Instruments France

0 Kudos
Message 4 of 5
(4,790 Views)
Hi,
if you do not have alternative DAQ card, you cannot detect changes instantly but might detect in milisecond level by adding latches before DAQ card, like 74LS373 to hold input change then watch latch output with DAQ card, under software control. Sure it has a presition problem.
Regards,
Ali Bayram


Message Edited by Abayram on 12-01-2007 08:54 AM

Message Edited by Abayram on 12-01-2007 08:55 AM
0 Kudos
Message 5 of 5
(4,329 Views)