Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

count leading and falling edges

Hello John,

          sorry for the confusion, I had made a simple wiring mistake and now everything is working as advertised. Thank you very much for all your help. The event detection is much more reliable than setting a timer with the PCI 6711 board to detect changes.

 

Thank you again.

 

George

 

0 Kudos
Message 11 of 40
(1,822 Views)

Hello All,

              I have modified one of the VB examples so I can watch edge changes and send pulses out two different channels in a three to one ratio. The example has a dialog box with a Start and Stop button to control it.

         I would like to modify the program so there is no interface and when you run the EXE, the program starts and continues to run. I am not sure how to create a second program to stop it.

 

        A simple version of this would be an EXE to set channel one high and another EXE to set the same channel low. Can I leave the program with the board in a high position and then get back in to access the board again with a second EXE to set it low?

 

Thank you.

 

George

 

0 Kudos
Message 12 of 40
(1,735 Views)

Does the NI USB6008 have the capability to count rising edges so I can measure RPM from a photo-sensor voltage signal?  Photo sensor changes from 1mV to about 2000mV upon photo sensor excitation.  I think my sensor frequency will be not too terribly high, like in the range of  100 Hz per channel, and we want to monitor 3 channels simultaneously.  To count the rising edges, do I need to write something in Labview, or is there a mechanism built in that can detect changes in voltage and identify the rising edge and time it for calculating RPM or velocity?

 

Thanks,

Dave

0 Kudos
Message 13 of 40
(1,668 Views)

Hi Dave,

 

The digital lines on the 6008 require a minimum of 2.0V to register as an input high (see the specifications).  The nominal voltage that your sensor is outputting is exactly this voltage, so this doesn't really leave much room for tolerance if the output voltage isn't exactly 2000 mV.  Also, there is only a single counter available to count edges, so you can't use the counter for all 3 channels.  Even for 1 channel, using the counter would require counting edges over a software-defined interval, so it wouldn't be the most accurate way to do this.

 

You could use the analog input lines of the 6008 to sample the output of your sensor, then programmatically calculate the frequency of your signal on each channel.  It sounds like the sensor frequency is low enough, and assuming an approximate 50% duty cycle the 10 kHz aggregate sample rate of the AI lines on the 6008 should be enough to catch all of your pulses.  This isn't really ideal but if you have to use the 6008 for this task then this is the way I would set it up.

 

 

Best Regards,

John Passiak
0 Kudos
Message 14 of 40
(1,659 Views)

Hi John,

 

Thank you very much.  At this time, I do not own the 6008.  I am trying to determine the best piece of hardware for my application and then buy one.  When you say "programatically calculate" do you mean that I would write code in Labview that measures voltage and identifies when the rising edge occurs and put in timing features to calculate the frequency?  Is there any example code that comes close to this?  I have been struggling to create a basic architecture to identify a rising edge, so, any clues or hints would be very welcome. Do the higher level modules like the PCI 6229 do this for me as a built-in function?

 

Is the 6008 just a voltage measuring device

 

Thanks,

Dave

0 Kudos
Message 15 of 40
(1,655 Views)

Hi Dave,

 

Essentially yes, but you should be able to use the Extract Single Tone Information function to compute the frequency as follows:

 

AI Detect Frequencies.png

 

The above code should work on the 6008 with reasonable accuracy.  The better method would be to condition your signal to make sure it is with certainty above 2 volts, and use a counter to measure its frequency.  X Series and cDAQ devices have 4 counters, so you should be able to use one of these if you'd like.  The lowest cost option to do this with counters would be the 9171 + the 9402 (or 9401 instead if you want screw terminals instead of BNC).  M Series devices (like the 6229) only have two counters so could not measure all 3 signals in this way simultaneously.

 

The 6008 can measure voltage, and also has static (software-timed) analog output, static digital I/O, and a single edge counter (the sampling of the edge-counter is also software-timed).

 

Best Regards,

John Passiak
0 Kudos
Message 16 of 40
(1,652 Views)

Hi John,

 

Thanks a lot for helping to shortcut this issue.  By the way, we can easily increase the value of our sensor signal.  It is currently about 2000mV, but, we can easily double it to 4000mV with no impact on anything else.  The value of 2000mV is somewhat arbitrary, and definitely not limiting.  It sounds like I need to buy the 6008.

 

We do not expect our frequency to be in excess of 100Hz.  It is likely to actually be much less, like, 10-20Hz per channel.  Given these low frequency values, do you think the 6008 would be OK for us? 

 

I own a NI-9211, which measures 14S/s, and my understanding is that the 14S/s is aggreate, meaning that 3 channels would share that rate, making any one channel about 4Hz, which is probably a little too slow for us.  In principle, could I use the code you list below with the 9211, at very low speeds?

 

Thanks,

Dave

 

0 Kudos
Message 17 of 40
(1,642 Views)

Hi Dave,

 

Whether or not the 6008 is suitable depends on your accuracy requirements.  You can always increase the resolution of your measurement by increasing the number of samples read back however, so I'd imagine this should be suitable unless you have very strict accuracy requirements.  The measurement resolution (in Hz) should be approximately the inverse of the sample duration (in seconds).  If you need to return accurate data more quickly then you should go with the counter option that I mentioned previously.

 

I really wouldn't suggest the 9211 for this type of application--you'd be better off with the 6008.  I think you'll find the 14 Hz aggregate sample rate (as well as the low voltage range) of the 9211 makes it unsuitable for measuring frequency.  Remember, you can only measure frequencies up to 1/2 of the sample rate (Nyquist-Shannon theorem).

 

 

Best Regards,

John Passiak
0 Kudos
Message 18 of 40
(1,639 Views)

Thanks, John.  It sounds like the 6008 is the best starting point.  I think I'll get that today.

Thanks again,

Dave

0 Kudos
Message 19 of 40
(1,635 Views)

Hi John,

I am using the Labview Base Development System, and I cannot find the "Extract Single Tone Information" on my pallette.  In the help section, it says "requires full development system".  So, would that require me to upgrade my version of Labview?  Is there an alternative to using this function?

Thanks,

Dave

0 Kudos
Message 20 of 40
(1,626 Views)