04-09-2009 12:41 PM
Hi all,
I am trying to acquire a digital signal (vertical deflection sync pulse) from a CCD camera using USB 6221 DAQ device. I can acquire at the moment. After that i want to invert the pulse because acquired digital signal is a negative with respect to ground. There is one more requirement, i e at every falling edge of the acquired digital pulse i want to generate analog signal with a positive value effectively out put waveform should be a pulse which will stay only in two states. I am attaching an image of what i want to do.
Thanks in advance
visu
04-14-2009 06:12 AM - edited 04-14-2009 06:13 AM
Hi Visu,
Good afternoon and I hope your well today. Thanks for your forum post.
Firstly, I don't believe your device supports any hardware solution for inverting or detecting edges. Therefore your solution will involve acquiring the signal (-0.8 to 0V) using an Analog Input (Digital is TTL).
You'll then need to perform some post processing on the acquired data. For this I would suggest using the producer/consumer design pattern to allow you to acquire the signal at the desired rate without the processing affecting the rate (or to prevent you losing samples). In terms of processing to dectect an edge I can suggest the Threshold Peak Detector.vi which outputs a count numeric - which is the number of times the signal has risen above the theshold (and dropped below it).
Lastely, you will require another DAQmx task - analog output to output a known value. Am I correct when I say you wish the AO to alternate between 0 and +V on falling edges of the Digital signal? As part of the processing you can have a shift registor with the last state of the AO and then just write the other value to update the AO. You can place the DAQmx Write AO in a case strucutre, so you only need to update the AO when you have an edge.
I have attached to code examples, in LabVIEW 8.6. One shows the main application design pattern I mentioned and the second a small piece of example code to show how the Threshold Peak Detector.vi works.
Note: As this code will require software timing, I was wondering what sort of rate the ditigal signal will be - and what sort of delay your application can require between a falling edge and the AO being updated?
Please let me know how this reply finds you and if you have any questions - also let me know if you need to VIs saved to a previous version.
04-14-2009 06:54 PM
Hi,
Thanks for the reply. I am using LV8.2 version so i could not open the vi's you sent. Could please send me screen shots of those two vi's.
Thanks a million!!
visu
04-15-2009 02:57 AM
Hi Visu,
Good Morning and I hope your well today!
Not a problem, attachted is the code in LabVIEW 8.2. Let me know what you think,
08-11-2009 11:18 AM
Hello Hillman,
Thanks for helpful VI. I have tested the main VI, its only giving output a DC value. As you mentioned about using threshold peak detector with the main VI, I have no idea of detecting peaks and changing them to a positive values with a case structure. Could you please attach some more information to understand it in detail.
Another question is can i covert analog input singla to digital and then inverting and again converting it into analog signal might give a solution.????
Please kindly reply.
Thanks a million!!!
Visu
08-25-2009 10:11 AM
Hi Viswa are you using this to log the data produced by your cam or to produce a signal to trigger other devices? To produce the output signal so it is synchronized with your input as show in your attached image you will need to use external circuitry. If you are logging the data how are you performing the acquisition (continuous or n-samples)?
Philip
08-26-2009 12:29 PM
Hi Philip,
Thanks for your reply. I have attached the VI which is working at the moment. I can acquire vertical deflection pulse from CCD camera (which is a TTL) as input continuously not n sample and DAQ card is able to produce positive analog output ( Image of the front panelis attached).
My task is to produce an analog output waveform which will remain in only two sates say 0 or 1 at falling or rising edge of input pulse. This is what i explained in the attached image of my first post of this thread.
I guess we can do it but still trying to figure it out. It is very necessary to my work for changing drive current level in laser interferometer.
{actually its not inverting TTL pulse but its synchronising with input and changing timing of the output pulse}.
Any help will be greatly appreciated!!!!!!!!!!!!
Thanks everybody
Visu
08-27-2009 05:24 AM
Hello Viswa here's your code that i have added a edge detection and toggle part to. Let me know if this is what you had in mind.
Philip