Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

triger each line mode doesn't work

Hi Scott,

thank you very much for your answer and for your patience.

> Is your application going to be completed in LabVIEW or in CVI?
My application has to be completed in CVI but I tried to check LabView example. Maybe I made it more complicated. Sorry for it.

> If you are not specifically trying to perform a ring acquisition
> and you don't need to trigger the buffers, I would suggest using
> a triggered grab instead of a triggered ring.
For me is sufficient to do triggered grab (trigger each line).

I made a simple program in CVI, which is based on llgrab example from basic NI-IMAQ samples set in CVI. Could you have a look at it. I really do not know what is wrong.
The CTR0 at PCI6221 is connected to TRIG1 on PCI1409.
When I use function "imgSessionTriggerConfigure2" (line 124 in C-code), the triggering is going properly.
When I use function "imgSessionLineTrigSource2" (line 123) and disable "imgSessionTriggerConfigure2" by // the triggering has no effect.

Screenshot from application after start is here.
Screenshot from running application is here.

The C-source is here.
The Header file is here.
The UIR file is here.

Looking forward your answer

Best regards

Lukas M.
0 Kudos
Message 11 of 17
(1,817 Views)
Lukas,

I noticed that your DAQmxCreateCOPulseChanFreq() function has a specified frequency of 1Hz. This means that each line will require 1 second to be read. If your image contains 480 lines, then it would require 480 seconds (8 minutes) to acquire a full frame. Try increasing the frequency of this signal and let me know if you are still not able to acquire a full image. I would recommend a frequency of 1KHz or greater.

Try this and let me know if you have any additional questions.

Regards,
Scott R.
Applications Engineer
National Instruments
Scott Romine
Course Development Engineer
National Instruments
0 Kudos
Message 12 of 17
(1,806 Views)
Hello Scott,

I have tried to adjust several frequencies in DAQmxCreateCOPulseChanFreq() in range 1 Hz - 1 kHz - 10 kHz.
But the problem is that function imgSessionLineTrigSource2 (Sid, IMG_SIGNAL_EXTERNAL, 1, IMG_TRIG_POLAR_ACTIVEH, 1)
has no effect. If I do not start trigger output (function starts after button "Trigger start" push), the number of aquired frames is all the time the same.

Looking forward your opinion

Best regards

Lukas M.
0 Kudos
Message 13 of 17
(1,797 Views)
Lukas,

What behavior are you seeing when you push the "Trigger Start" button? How many frames are you able to acquire? I noticed that you are using the function call DAQmxCfgImplicitTiming(taskHandle,DAQmx_Val_ContSamps,1000). The last parameter in this function describes how many samples to take on the channel. In this instance, that means that 1000 triggers will be generated. Depending on the number of lines in your image, you may only get 1 or 2 images before the sequence completes.

Regards,
Scott R.
Applications Engineer
National Instruments
Scott Romine
Course Development Engineer
National Instruments
0 Kudos
Message 14 of 17
(1,788 Views)
Scott,

thank you for the answer.
The agrument 1000 has no effect in this case: DAQmxCfgImplicitTiming(taskHandle,DAQmx_Val_ContSamps,1000), the pulses are being produces all the time (not only 1000 pulses).

1) if I use imgSessionTriggerConfigure2 (Sid, IMG_SIGNAL_EXTERNAL, 1, IMG_TRIG_POLAR_ACTIVEH, 5000, IMG_TRIG_ACTION_BUFFER); for triggering, the whole frames are being captured with frequency of 40 Hz :
DAQmxCreateCOPulseChanFreq (taskHandle, "Dev1/ctr0", "", DAQmx_Val_Hz, DAQmx_Val_Low, 0.0, 40, 0.5);

2) but if I use imgSessionLineTrigSource2 (Sid, IMG_SIGNAL_EXTERNAL, 1, IMG_TRIG_POLAR_ACTIVEH, 1); instead, the trigger has no effect than. Even If I do not start pulses production (by the button Trigger start - function trigger_start) , the frames are captured in the maximal frequency (66,67 frames per second - 512 pixels width ... cca 34 MHz line frequency). The trigger pulses are IGNORED

When I do not use function trigger_start in the first case, the
NON-FATAL RUN-TIME ERROR

Function imgSessionCopyBuffer: (return value == -1074397150 [0xbff60022])
Did not receive all expected video data within the timeout period.

I use NI-IMAQ 3.1.1 and I am affraid if there is some bug.

Best regards

Lukas
0 Kudos
Message 15 of 17
(1,745 Views)
Hi Lukas,

So in one case, it appears as though you are using a 'start of acquisition' trigger (case 1) and in the other case we are requiring a trigger for each acquired line (case 2).

In case 1, does your acquisition rate change with the parameter you set in the daq pulse command?

In case 2, the images are acquired even if the board is not sent any triggers?

Finally, is this all starting with the code you posted earlier?

- Robert
0 Kudos
Message 16 of 17
(1,721 Views)
Lukas,
 
Is your trigger signal being connected directly to the camera, or are you connecting your trigger to the PCI 1409?  The trigger-each-line functionality requires that the trigger be received directly by the camera, to determine when it will acquire data from the next line of the CCD sensor.  If you are connecting that trigger line, try using a volt-meter or DMM to determine if the voltage on that line is actually changing.
 
Regards,
Scott R.
Applications Engineer
National Instruments
Scott Romine
Course Development Engineer
National Instruments
0 Kudos
Message 17 of 17
(1,676 Views)