Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

Setting Camera Attributes Using .NET (C#)

Hello:

 

I am using Imaqdx.dll component library (using NationalInstruments.Vision.Acquisition.Imaqdx;) with Visual Studio in C# for mu camera application. I can not retreive the function ImaqdxSetAttributes() to set any camera attributes.

 

In no way I can figure what is the function to set any camera attributes. Could anyone can tell what is the simple function to set any camera attributes or how to retreive it.

 

Thanks,

 

rafiou

0 Kudos
Message 1 of 4
(3,870 Views)

Hello again:

 

I found myself how to do that. For those who still looking how to do in C# here is a sample of code who set the value of a camera attribute:

 

object exposureTime = (double)ExposureValue;

ImaqdxAttributeCollection attrCollection = _session2.Attributes;

int attributIndex = 63; // index of the attribute name you want to change (you can look into the ImaqdxAttributeCollection  to find out the index position of that attribute ). In my camera case 63 is the Exposure Time 

attrCollection[63].SetValue(exposure);

 

That's all. Very simple but not documented anywhere.

 

Rafiou

 

 

 

 

0 Kudos
Message 2 of 4
(3,862 Views)

Hello Rafiou,

 

Thanks for this information. I am also creating a program in C# to get and set these camera attributes in VS2012 windows form. I am only a beginner at this, learning as I go and still having troubles.

 

I am having trouble accessing the -  ImaqdxAttributeCollection attrCollection = _session.Attributes  values.

 

If you can be as kind as helping me with any working code. I would greatly appreciate it. 

 

Thanks for your time.

Chris

 

0 Kudos
Message 3 of 4
(3,133 Views)

Chris,

 

Regarding your questions about VS2012 IMAQdx functions, there should be a number of text-based examples included in the help documentation for the IMAQdx drivers. These would be the best sources on which to base your program. It appears that the latest version of Visual Studio that includes help documentation is 2008, so reverting to that development environment would be helpful as well. If you have specific questions regarding errors or format, I would always recommend creating a new forum thread as well.

0 Kudos
Message 4 of 4
(3,110 Views)