Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Why does triggering not work for line scan cameras?

I am using a Dalsa line scan camera, 2k and 4k camera link, through a NI-1428 interface board on a Windows XP box with Labview 8.2. I can control most of the camera functions programatically but not the Exposure Mode. In fact, the Exposure Mode does not seem to work at all. Forget my program for the moment and lets just look at MAX.

I open up either camera in MAX, select the correct icd camera file, and look at the settings. In the Camera Attributes section I set the Data Mode to 8 bit. The only other one of interest is the Exposure Mode. For the sake of brevity I am only interested in two modes.

Mode 2 is basically free run mode. Set the line reate of the camera within the bounds and it triggers off the camera pixel clock. This seems to work fine.

Mode 6 is external triggered mode. Connect up the NI cable to the 1428 board and plug a sig-gen into the BNC to trigger the capture. Start the Grab in MAX and it seems to capture happily. Unplug the BNC and it continues to trigger happily. Start the grab with no trigger input and it runs as if in free run mode.

So, Mode 6 does not seem to work. I can change the mode and it seems to change the value in the icd file. But it does not make any difference to the operation of the camera. Needless to say, it does not work in my program either.

I do seem to remember that I got the 2k camera working in 7.1 with regards to Mode 6. Has something changed with 8.2?

Has anybody else ever used Dalsa line scan cameras with Labview?
0 Kudos
Message 1 of 6
(3,880 Views)
OK, I did some further mucking around. I experimented with changing the Trigger Action on the IMAQ Configure Trigger2.vi from "Trigger each line (line scan)" to "Trigger each buffer". I have a buffer length of 256 lines. Now the trigger signal does seem to have an effect. But, of course, it only controls how often the buffers start. If I turn off the trigger signal the capture stops. The capture starts again when I turn the trigger signal on (as desired). However, this only mediates the capture in buffer length blocks. The line rate in the buffer block is still coming out of the ether.

So I made the buffer length 1 line. It had to allocate 8192 buffers, which took a while, and then took ages to display all this. I suppose I could leave the display part until the end of the capture but at this point I feel that I am having to build a workaround for something that does not work properly. Is that what I have to do?

Why does the "Trigger each line (line scan)" mode not work as described? Have I missed something in the setup? Has anyone else had this problem?

Peter
0 Kudos
Message 2 of 6
(3,853 Views)

Hello Peter,

There are a large number of issues to address here, but to begin with have you tried running the example, LL Tringgered Ring.  Running this example, with a simple modification to the type of trigger (you want Trigger Each Line), should do what you are looking for. 

Secondly, what camera file are you using, and have you ensured that you are saving it in MAX before you use it in LabVIEW?  The exposure mode is different depending on what camera you are using, even given the fact that it is a Dalsa camera.

Regards,

Jasper S

0 Kudos
Message 3 of 6
(3,822 Views)
Hi Jasper,

Yes, I have tried running the example LL Triggered Ring. It exhibits the same behaviour with Trigger each buffer as I see in my program, that is, the triggering starts the buffer capture which then runs at some unknown line rate. When I change it to Trigger each line I get a time out error, which is different to my program.

I am using the Dalsa P2-2x 4k40.icd camera file and, yes, I am saving it in MAX before I am using it. I have read the Dalsa manual and I am aware of the different exposure modes. All the exposure modes work except under Labview when trying to trigger each line.

I have operated this camera using a Leutron frame grabber and a C++ program that I wrote and I have no trouble making the Dalsa Mode 6 (line triggered mode) work in that environment. I have investigated the different exposure modes in Labview and they all seem to work EXCEPT for line triggered.

My frustration is that the Labview routines do not work as expected.

Peter
0 Kudos
Message 4 of 6
(3,819 Views)
At last, some progress! The LL Triggered Ring without Timeout example does appear to respond to the Trigger each line mode. The difference is that it polls the last valid frame and only fetches the data when the buffer is full. Changing the trigger signal frequency does appear to change the capture frequency.

The difference between this example and the LL Triggered Ring example is that IMAQ Extract Buffer is not called until the camera has moved onto the next buffer. This implies that the IMAQ call to the same buffer as to that which the camera is writing is the cause of the problem. This makes sense in retrospect but is not immediately obvious from the example names or the documentation.

Can I suggest that the LL Triggered Ring without Timeout example be renamed "LL Trigger a linescan camera on each line this way" with comments to explain that IMAQ Extract Buffer should only be called when the buffer is full and not being written to by the camera.

The information is there but it just took an awful long time to figure it out! Time now to do some real work...

Cheers,

Peter
0 Kudos
Message 5 of 6
(3,817 Views)

Could you provide a example code that solves this problem? 

Cheers,

PK

0 Kudos
Message 6 of 6
(1,997 Views)