Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Linear Image sensor DAQ

Hi.

What I am trying to do is: using NI 6036E to get linear image out put from a image sensor. I use ANSI C in VC++. I want

1. Generate 1.25 MHz clock signal from CTR 1. I can do this by example DigPulseTrainCont.c. This clock signal goes to my image sensor.

2. With the clock signal running, then I want generate a start pulse with two clock signal width using CTR0 (pin 2). This start signal also goes to my image sensor. I try to combine example code of DigPulse.c into DigPulseTrainCont.c, but got problems. I am not quite sure if I should just use one task or multitask. And seems code of DigPulse.c can not generate pulse width shorter than 1 second ?

3. Once the start signal sent to the sensor, the sensor will generate trigger and video signal (256 pixels). I want put trigger at PFI 2 (pin43), and video signal to AI 0 (pin 68). Then do AD convert got digitized video signal. I think example Acq_IntClk_Dig_Start&Ref may deal with this situation.

4. Also I want to set P0.3, PO.7, PO.2 (pin 47, 48, 49) at high level (+5V).

I just do not know how can I put all this together.

Please help me

min_min35@yahoo.com
0 Kudos
Message 1 of 4
(3,248 Views)
Hello Fish,

Your application looks really interesting, I'm going to try to help you out as much as I can. You can have multiple tasks in the same program as long as they are all different (analog input,analog output, digital input, digital output, counter input and counter output.) You cannot have for example two analog input tasks running at the same time, however you can stop the first analog input task and start the other.

Are you getting an error when wanting to generate a pulse width shorter than 1 second?

Hope this helps!

LA
0 Kudos
Message 2 of 4
(3,232 Views)
Hello, LA,

Glad to have some one to help me out. I am stuck again. :(. I figured out several things, that about multitask and generate pulse signal.

Can you help me make clear how should I use example
'Acq-Int Clk-Dig Start&Ref' ?

What I have already done are:
1. Generated 1000 Hz clock signal to Dev2/ctr1, and keep it running.
2. Then generated a start signal to Dev2/ctr0.

These goes to my sensor, and my sensor return trigger and video signal back.

I can see it works on the oscilloscope.

Then I use example of 'Acq-Int Clk-Dig Start&Ref', try to get the video signal using trigger as reference.

I use ctr1 as source of the Sample Clock, video signal goes to ai0, ctr0 as start trigger, and PFI2 as reference trigger. I connected the trigger returned from sentor to PFI2.

The code looks like:

Configure_AcqIntClkDigStartRef("Dev2/ai0","/Dev2/ctr1",0.0,5.0,1000,10000.0,"/Dev2/ctr0","/Dev2/PFI2",DAQmx_Val_Rising,DAQmx_Val_Rising,100,&taskHandle3,NULL)


Then it gives the Error:


DAQmx Error: Source terminal to be routed could not be found on the device.

Make sure the terminal name is valid for the specified device. Refer to Measurement
& Automation Explorer for valid terminal names.

Property: DAQmx_SampClk_Src
Property: DAQmx_SampClk_ActiveEdge
Source Device: PCI-6036E: "Dev2"
Source Terminal: ctr1

Task Name: _unnamedTask<3>

Status Code: -200040


I do not know how to do now. Help me out please.
For better understanding what I am trying to do, I attatched the link of the sensors.
http://usa.hamamatsu.com/assets/pdf/parts_S/S8377_S8378.pdf
http://usa.hamamatsu.com/assets/pdf/parts_G/G9211-256S_etc.pdf

Actually, I used two linear image sensors. They works very similar. The problem is that they need different clock frequency. And I try to get the signal almost at the same time. I am not sure how should I put them together. One solution I can think is to get video signal from one sensor first, then change clock frequency and get signal from the second sensor. If you have better way to do this, let me know please.

Thanks a lot

Fish
0 Kudos
Message 3 of 4
(3,222 Views)
Hello Fish,

I was trying to look for the function that you placed on your message but I was not able to find it. Are you trying to route counter 1 out to the sample clock of your analog input? If so, I would recommend you to try to route Counter1InternalOutput to the sample clock. If you try route Ctr1Out, then you will need to route your counter 1 out to a PFI line and then to your sample clock. Also I would encourage you to go to MAX and check the Device Route tab to check if your internal routes are possible and if so, what resources are being used.

Hope this helps!

LA
0 Kudos
Message 4 of 4
(3,213 Views)