LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Digital filtering on PXI 6527 with DAQmx

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

0 Kudos
Message 1 of 7
(3,492 Views)
0 Kudos
Message 2 of 7
(3,482 Views)

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.

0 Kudos
Message 3 of 7
(3,478 Views)
Your right, I should have caught that.
0 Kudos
Message 4 of 7
(3,474 Views)

Nobody has idea about this in DAQmx?

0 Kudos
Message 5 of 7
(3,441 Views)

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.

0 Kudos
Message 6 of 7
(3,324 Views)

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);


 

0 Kudos
Message 7 of 7
(3,312 Views)