Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

How to change camera attributes using labview?

Hi,

I'm having trouble setting attributes for my Camera. My environment is as follows...

Labview version 6.1
IMAQ version 2.5.4
MAX version 2.2.0.3010
Camera - Dalsa SP-14-01K40
Card - IMAQ PCI 1422

I'm trying to adjust the camera by setting attributes (e.g gain) from a vi. I use Set Camera Attributes.vi to make the change.

When I then use the Get Camera Attribute.vi to check the change it returns the newly set value.

However, using MAX to check the camera output no change has occured (e.g. increasing in gain doesn't produce a brighter image). Using MAX to check the camera properties shows the attribute hasn't changed.

Please see attached .vi for an illustration.

Can anyone point out where I a
m going wrong?
0 Kudos
Message 1 of 10
(10,556 Views)
It looks like your program is working fine.

When you change an attribute in LabVIEW, it is not permanent. It only lasts while the program is running. MAX is the only way to change the settings permanently.

Bruce
Bruce Ammons
Ammons Engineering
Message 2 of 10
(10,553 Views)
Hi Bruce, thanks for your swift advice, I didn't expect anything so soon.

Your advice about attribute changes not being perminant is very useful. I assumed the settings file was being updated. Our application will need some sort of setup file system in the long run, to ensure settings can be repeated.

Regarding attribute changes, I have found that if I use a Grab function from within the same program as I change the attributes there is still no change to camera function (e.g. increased gain doesn't produce brighter image).

Apologies for no example code - I prepared an example but get an error every time I try and transfer it to this reply. I'll keep working on that and hope to get the example up here soon.
0 Kudos
Message 3 of 10
(10,553 Views)
Hi Bruce, thanks for your swift advice, I didn't expect anything so soon.

Your advice about attribute changes not being perminant is very useful. I assumed the settings file was being updated. Our application will need some sort of setup file system in the long run, to ensure settings can be repeated.

Regarding attribute changes, I have found that if I use a Grab function from within the same program as I change the attributes there is still no change to camera function (e.g. increased gain doesn't produce brighter image).

Apologies for no example code - I prepared an example but get an error every time I try and transfer it to this reply. I'll keep working on that and hope to get the example up here soon.
0 Kudos
Message 4 of 10
(10,553 Views)
Another useful bit of information - you can't change some attributes in the middle of a Grab. If you check the error output, you will probably see one. You have to stop the Grab, change the attribute, and restart the Grab. For testing attribute changes, it is easier to use Snap. The video display will be a lower frame rate, but the programming will be a lot easier.

Bruce
Bruce Ammons
Ammons Engineering
0 Kudos
Message 5 of 10
(10,553 Views)
Very useful info. I thought I was stopping and starting the grab in an appropriate fashion, but maybe I'm not after all. I tried using snap instead, and that seems to work fine. Gain adjustments do now vary the brightness of the image.

From this I'm certain a snap will do the job while we are setting up the camera, and we can do a grab or a sequence later to acquire our data.

Thanks for all your help Bruce, I'm a happy chap once more. 🐵
0 Kudos
Message 6 of 10
(10,553 Views)
Hi all!!!
 
How can I make the same for ImaqDx (to control the attributes of a firewire camera)?
 
Thanks
0 Kudos
Message 7 of 10
(10,187 Views)

I believe IMAQdx has a vi to enumerate all the camera parameters.  Use this to figure out the parameter strings.

You should be able to set an active parameter using a property node, then change its value.  The input for the active parameter is the above string.

Bruce

Bruce Ammons
Ammons Engineering
Message 8 of 10
(10,171 Views)

Hi,

 

It´s solved, like the file in attach.

 

regards

0 Kudos
Message 9 of 10
(10,162 Views)
Refer to these posts for more information on setting/saving attributes:

http://forums.ni.com/ni/board/message?board.id=200&message.id=13783

http://forums.ni.com/ni/board/message?board.id=200&message.id=13287

Hope this helps,

JohannS
0 Kudos
Message 10 of 10
(10,100 Views)