10-05-2012 12:38 AM
I am trying to count pulses from a quadrature encoder using cDAQ system with DIO module NI 9403and AI module 9205. I dont have h/w with inbuilt counters, so have to do away with whatever i have. I programmed to compare the incoming signal with a reference voltage level (3Volt) and count the number of times it exceed that level. This way I should know the number of times pulses are generated.But the program is not working.
The encoder is of **bleep**or automation make (Model: S 3000) which generates 3000 pulses per revolution.
Please help.
10-08-2012 11:34 PM
I have not got any reply for my problem. Let me reframe it.
I need a program in which count is to be incremented whenever analog voltage level exceed a certain value (say 4volt).I am using NI 9205 as AI module.
Thanks.
10-09-2012 03:28 AM
I tried to write a program that is attached here.The pulse counts I am getting is much lesser than the actual value.The same signal is captured in MAX (image attached).It means missed pulse count is a result of my program. Please suggest.
10-16-2012 03:18 PM - edited 10-16-2012 03:30 PM
The better way to do this (if you want to trigger off of a configurable voltage level) would be to configure an analog trigger and count the "analog comparison event" using an on-board counter (there are 4 on the 9178 which I think you are using based on your other thread).
I don't have a cDAQ chassis handy but I think something like this should work (if you don't want to read back analog data you can replace the read with an "Is Task Done?" call and add a wait to the loop, you may need to configure the task to overwrite unread samples if you do this):
If your input is a TTL signal and you don't actually need to configure the trigger threshhold, you may instead route the PFI line on the 9205 directly to the backplane counter without using an analog input task (EDIT: You'll want a wait call inside this loop since the task is no longer blocking the loop execution, ~100 ms should be sufficient to throttle your loop rate to avoid unnecessarily spinning the CPU):
Best Regards,
05-23-2024 05:20 AM
Hello John,
I tried to rebuild your VI because I want to calculate the frequency of a TTL signal (the only looks like a TTL signal while the turbine is rotating). The main goal is to calculate the flow rate of a turbine through the obtained frequency. The frequency ranges from 0 to 2000 Hz. I also tried to calculate the frequency with a "Tone measurement" block, but this gave me bad results. From my understanding, the input voltage signal should be kind of constant when using this block, which isn't the case for my application.
Since I want to measure a frequency of 2000 Hz at max, I use a sample rate of 4000 (because of the Nyquist-Theorem) and 800 samples per loop.
I'm using a NI 9178 chassis and a NI 9205 card. I'm not really sure, what my input values for "Hysteresis" and "Level" should look like.
Thank you!