11-05-2009 12:02 PM
Hi all,
I have a CCD analog monochrome camera of CCIR standard and PAL format with 25frames/sec. I want to control the camera by generating external H-sync and V-sync pulses using USB6229 DAQ card (I am using LabVIEW 8.2 version).
By the way H-sync has frequency of 15.625kHz with baseline voltage 0 V upto -2.7V and a V-sync pulse has frequency 50Hz with baseline 0V upto -2V.These sync pulses were generated by internal camera clock.
I got both sync pulse parameters checking them on GOULD oscilloscope.
Now i want to produce the same sync pulses using DAQ card (By changing the camera change over sync switch to external sync so that it accepts external pulses.
I have confusion about these sync pulses are they digital or analog signals? If they are digital can somebody help me to write code for it. I was looking in example folder for it but not successful using one of them which suits me.
I have attached CCD camera spec sheet (http://www.crijolanta.com.pl/produkty/pulnix/pe2020.pdf) and vertical sync pulse image obtained from oscilloscope.
Any help would be greatly appreciated.
11-09-2009 11:36 AM
Hi Viswa,
This is a brief post to notify you that I am now looking into your issues for you. Firstly I must warn you that I am no expert on your particular camera and adhering to the CCIR standard.
What I hopefully can help you with is the nature of your sync pulses, how to re-create them in LabVIEW and the limitations of your NI USB-6229 M series multifunction DAQ card. From the images you have posted I can conclude that the pulses would be best created using a digital output task where the pulse width is specified as a percentage of the overall period (using a measure known as the duty cycle). Unfortunately, this is not feasible using your DAQ device since it uses TTL which means it is only capable of outputting voltages between 0V and 5V (your pulses vary between 0V and -2.7V).
Alternatively, it should be possible to re-create these sync pulses using an Analog Output task using a function called regeneration. This function means your DAQ device should be able to regenerate samples that it already generated. In your case a single pulse could be written to the buffer and regeneration could be used to output the continuous waveform.
I am going to attempt to re-create these sync pulses using an analog output task which employs regeneration. In the meantime, you may want to take a look at an example which can be found in the NI Example Finder, which exemplifies the regeneration methodology. This can be found at:
Hardware Input and Output > DAQmx > Analog Generation > Voltage > Cont Gen Voltage Wfm-Int Clk-On-Board Regeneration.vi
I hope this helps and I will be in contact shortly,
Christian Hartshsorne
Applications Engineering
National Instruments UK
11-10-2009 06:48 AM
Hi Viswa,
Further to my post yesterday afternoon, I have had some success in re-creating your sync pulses using an analog output task which uses regeneration. This is based on the example I highlighted in my previous post.
I decided the best way to re-create your waveform would be to produce an array of data which represents a single waveform and regeneration would then be used to produce the continuous waveform. Firstly, I tried to create an array which represented your H-sync data (the 50Hz waveform). The completed waveform has a period of 20ms and I assumed that the pulse widths were 2ms (you may need to specify this more accurately). For the sake of this example I chose a sample rate of 1000 samples/s which meant a complete waveform constituted 200 samples. The array was then generated using a For Loop and some simple array manipulation as can be seen in the attached example.
A further issue arose when I attempted to generate two independent analog voltages (representing both your H-sync and V-sync waveforms) using your NI USB-6229 DAQ card, it seems that this is not possible. The only way I could think of to alleviate this problem was to generate the two arrays separately and then merge them into a 2D array and then write them to a multichannel analog output task. This will allow you to generate the two signals using your DAQ device which can be acquired and observed using the following example in the NI Example Finder:
Hardware Input and Output > DAQmx > Analog Measurement > Voltage > Cont Acq&Graph Voltage-Int Clk.vi
As mentioned, I have attached an example VI which shows how two analog signals can be generated. The first waveform is representative of your H-sync waveform (although you may need to alter the numbers representing the number of samples and the pulse width) however, you will need to modify the characteristics of the second waveform in order to re-create your V-sync waveform. This should be fairly straightforward if you follow the methodology outlined in the example.
I hope this helps you but if you require any further assistance let me know.
Christian Hartshorne
Applications Engineer
National Instruments UK
11-10-2009 09:51 AM
Hi Christian,
Thanks a mil!! for your help. Could you post the code in LV8.2? I will look at it and try to optimise for desired parameters for my work. I will let you know if i come across any problems.
11-10-2009 10:10 AM
Hi Viswa,
Here is the LabVIEW 8.2 version of the example.
Regards,
Christian Hartshorne
Applications Engineering
National Instruments UK
11-10-2009 10:11 AM