11-18-2013 03:13 PM
Hello,
I'm working in a program NI 6009. I want to drive leds with digital output of NI 6009. For example, first led will be on until 200 micro seconds then second led will be on until 200 micro seconds, then again first led will be on until 200 micro seconds. I will take led signals with photodedector and connect photodedector output to analog input of NI 6009. I want to synchronize digital output and analog input channels and separate first and second led signals from analog input channel of NI 6009. How can I do it with NI 6009? Please adv.
Solved! Go to Solution.
11-18-2013 03:39 PM
You cannot do that with the USB-6009. Its digital outputs are software timed with a maximum speed slightly greater thna 100 samples per second. The outputs cannot produce 200 microsecond pulses and cannot be synchronized with the analog input.
You need a device with hardware timed digital outputs or counters which can produce pulse outputs.
You can somewhat synchronize the digital output and the analog input by recording the DO signal on an additional AI channel. That will allow you to see the photodetector and the LED drive with the same timing and resolution as set by the AI sampling rate. The maximum sampling rate for AI on the USB-6009 is 48 kHz which is shared among all channels. If you have two LED signals and two photodetector signals the maximum sampling rate would be 48 kHz/4 = 6 kHz which is just barely fast enough for your 200 us signals. For more than 4 channels it will not be fast enough.
I would suggest building a simple oscillator circuit and use it to clock a flip flop. That will give you alternating signals to drive the LEDs. You could use a DO line to reset the flip flop to give you control without requiring high speed.
Lynn
11-19-2013 11:52 AM
Thanks for clear and quick response. I have one more question. I will build a simple oscillator and control it using DO. I have one photodedector and photodedector output signal contains two led information every 400 micro seconds. When I connect photodedector output to AI, I want to separate led1 and led2 signals. I mean first 200 micro second is a data for led1 signal and next 200 micro second is a data for led2 signal. I want to sample AI every 200 micro seconds and separate led1 and led2 signals. (during 200 micro second one sample is enough but it can be more.) Can you adv how can I do it?
11-19-2013 12:57 PM
Hello Anil5,
This sounds a lot like photoplethysmography homework- why don't you post the code you've already written and point out where you're having specific issues?
Lynn's suggestion of reading the oscillator's state (output) on a second AI channel and using that to determine which LED is on at that time is probably your best bet.
Regards,
11-19-2013 02:10 PM
Thanks Tom. That is exactly what I recommend.
Lynn
11-20-2013 11:58 AM
Hello Tom,
Thanks for response it was a good guess 🙂 but I work on a kind of simple spectrometer just hoby. I understood what you mean. I will work on your suggest if i have any problem I will write again send you design.