04-10-2006 09:02 AM
Hi,
I need some help. I am trying to use digital filtering with PXI-6527 card.
I would like to filter glitches when I read the state of input. For this I am using the following DAQmx functions:
DAQmxSetChanAttribute (uiTaskHandle, szNomVoie, DAQmx_DI_DigFltr_Enable, TRUE);
DAQmxSetChanAttribute (uiTaskHandle, szNomVoie, DAQmx_DI_DigFltr_MinPulseWidth, 0.1);
DAQmxReadDigitalLines (uiTaskHandle, 1, 5.0, DAQmx_Val_GroupByChannel, data, 1, &read, &bytesPerSamp, NULL);
Unfortunately, that's not working properly. It's working such as if no filter was configured.
Then I tried using change detection with digital filtering by using following function before reading operation:
DAQmxCfgChangeDetectionTiming (uiTaskHandle, szNomVoie, szNomVoie, DAQmx_Val_ContSamps, 1);
And in this case, that works perfectly. But that is not my goal. Indeed I'm not looking for change detection but for reading input line.
So is my question:
Is it possible to use digital filtering on input line without change detection and how can I do this? (What is wrong with my procedure?)
Looking forward for a reply.
Thanks.
Seb
04-10-2006 09:16 AM
Did you call DIG_Filter_Config()
http://digital.ni.com/public.nsf/allkb/505E261EAC381C0086256931007D6DF1
04-10-2006 09:27 AM
In fact I'm using only DAQmx functions and DIG_Filter_Config() is a DAQ function. I thought that DAQmx_DI_DigFltr_Enable and
DAQmx_DI_DigFltr_MinPulseWidth properties could replace the DAQ function.
04-10-2006 09:39 AM
04-24-2006 02:19 AM
Nobody has idea about this in DAQmx?
11-14-2006 02:06 PM
I am trying to do the same thing, but I don't have a setup to simulate this.
I was expecting to use both of the below, but I can not find info telling me how these interact. I just guessed at 100 times.
//Set the filter register
DAQmxSetTimingAttribute (hTaskHandle, DAQmx_SampClk_DigFltr_TimebaseRate, dDIGFilterTime*100);
//Set the min pulse time
DAQmxSetTimingAttribute (hTaskHandle, DAQmx_SampClk_DigFltr_MinPulseWidth, dDIGFilterTime);
Please post if you find the solution or if the above works.
11-15-2006 09:02 AM
Try this:
DAQmxErrChk (DAQmxCreateTask("",&hTaskHandle));
DAQmxErrChk (DAQmxCreateDIChan(hTaskHandle,szResource,"",DAQmx_Val_ChanForAllLines));
DAQmxErrChk (DAQmxSetDIDigFltrMinPulseWidth(hTaskHandle, szResource, dDIGFilterTime));
DAQmxErrChk (DAQmxSetDIDigFltrEnable( hTaskHandle, szResource, ucFilterMask ));
DAQmxErrChk (DAQmxStartTask(hTaskHandle));
DAQmxStopTask(hTaskHandle);
DAQmxClearTask(hTaskHandle);