Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I make an exposure time change take effect before capture starts

I am using a Dalsa P2-2048 line scan camera to grab images using IMAQ. I want to be able to change the exposure time between scans. I find that when I use the IMAQ Start.vi there is a considerable time delay as the camera file is read and the exposure time set to the value in the file. This means I have to set the exposure time after I have called Start. This then means that the exposure time changes during the first 100 lines or so of the scan which is not acceptable.

I have tried using IMAQ Set Camera Attribute.vi to write to the camera file and found that this corrupted the file.

Is there another way around this. I find that having the Start vi reading the exposure value from a file to be a very clunky way of doing things. The exposure time is stored on the camera and so does not have to be set by the start vi every time I want to start a capture.

Cheers,

Peter
0 Kudos
Message 1 of 5
(3,626 Views)
Peter,

The Dalsa P2-2x-02k40 camera uses the camera link connection which has serial command lines built in. Serial commands are sent to the camera to change certain attributes - these are set in the camera file. You can also directly write serial commands to a camera using the IMAQ Serial Write.vi. Dalsa has documentation available for your camera (link: http://vfm.dalsa.com/selector/prodinfo.asp?lbxProd__ID=P2-2x-02k40)

Their documentation will have the serial commands that set the various attributes of the camera - I believe that the exposure time will be: set x\r (where set stands for set exposure time and x is the value you are setting) - but check your user manual to be sure.

Sending the proper serial command with the IMAQ Serial Write.vi will change your exposure time without having to reference the camera file. Also, you should be able to do this while you are acquiring.

I hope that this solves your problem - let me know if you have further related questions. Good luck with your project!
Message 2 of 5
(3,619 Views)
I use the SERIAL Write vi to set the camera exposure time. The problem is that the IMAQ Start vi does its own write to the camera and resets the exposure time back to what was in the camera file.

Therefore, the only way to change the exposure time is to do it after the IMAG Start vi. It then seems to take some number of lines to take effect, or maybe I just have to wait for 0.5secs (great for cycle times).

The obvious solution is to programatically write to the camera file so that IMAQ Start reads the correct value. However, this can corrupt the file and the whole system crashes. Not a good look.

Is there another version of IMAQ Start somewhere that does not write from the camera file to the camera?

Cheers
0 Kudos
Message 3 of 5
(3,616 Views)
I would suspect you could edit the icd file and take out the line that sets the exposure time. This would leave the camera in whatever state it started in.

Another option would be to set up an attribute that you can control the exposure time. The attributes are always updated when you start an acquisition, if I remember correctly. I think you could set up your acquisition, set the attribute, then start the acquisition.

Bruce
Bruce Ammons
Ammons Engineering
Message 4 of 5
(3,598 Views)
Thanks Bruce,

This makes so much sense that I feel foolish for not having thought of it myself.

Cheers,

Peter
0 Kudos
Message 5 of 5
(3,565 Views)