02-11-2008 07:58 AM
countTask =
new Task();countTask.CIChannels.CreateCountEdgesChannel(grossCountConfig ,
"COUNTIN", CICountEdgesActiveEdge.Rising, 0, CICountEdgesCountDirection.Up);countTask.Control(
TaskAction.Verify);countTask.CIChannels.All.CountEdgesDigitalFilterEnable =
true;countTask.CIChannels.All.CountEdgesDigitalFilterMinimumPulseWidth = 5.0e-6;
myCounterReader =
new CounterReader(countTask.Stream);countTask.Start();
Just a couple more questions,
Now, when I see "countTask.CIChannels.All", I presume this will filter all the counter channels assigned to this task, right?
Also, I know there is a way to test this filter out, but how would I go about doing that? Would I use some sort of pulse train?
If someone could either send me some C# code or point me to a good example of how to test the filter that would be very helpful.
Thanks for all your help in advance!
Matt
02-12-2008 06:50 PM
Hi Matt,
You are right in the assumption that "countTask.CIChannels.All" will operate on all the channels in that specific task. One way to test the filter is by using a pulse train where the pulse width will be smaller than the filter. I see that you are setting up a 5us pulse width filter. I verified in the 6601 user manual that a 5 us filter should block a pulse width of 2.5 us or smaller. So you could test that the filter is working by using a pulse train of 2.5 us width or smaller, in which case your task should not count any edges. I suggested that pulse width because pulse widths between 2.5 us and 5 us may or may not pass depending on the relationship of the pulse's phase and the filter's timebase clock. Unfortunately I couldn't find an example that does exactly what you are trying to accomplish, but there are several C# examples that can give you some ideas on your counter application. These examples must be found in your computer on \National Instruments\NI-DAQ\Examples\DotNET2.0\Counter\.
Regards,
02-14-2008 06:55 AM
Hi Ana,
Thanks for the reply. I don't have the \National Instruments\NI-DAQ\Examples\DotNET2.0\. folder on my pc.
Does this come with the new NI-DAQmx 8.6.1 software? If not where can I download this sample code?
I am currently using NI-DAQmx version 8.0.11.12.
Thanks,
Matt
02-18-2008
05:28 PM
- last edited on
10-13-2025
03:46 PM
by
Content Cleaner
Hi Matt,
The examples are installed when you install the DAQ drivers. Since I don’t know what drivers you have this knowledge base should be helpful in finding them: Programming NI-DAQ in Microsoft Visual Studio .NET. I hope this helps,