Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

C# / .NET API equivalent for imgGetCameraAttributeString, etc.

Solved!
Go to solution

Hi,

 

I have some software written in C against the C API for IMAQ.  I'd like to port it to C# and the .NET API.  However, after looking through the documentation for the .NET class libraries (Vision.Acquisition.Imaq namespace), I can't find an equivalent for the following C API functions:

 

imgGetCameraAttributeString

imgSetCameraAttributeString

imgGetCameraAttributeNumeric

imgSetCameraAttributeNumeric

 

Did I miss something in the docs somewhere?  If not, can I call the C functions from C# via P/Invoke?  It's not clear how that would work, since the C API requires a SESSION_ID which I don't know how to get from an ImaqSession object.

 

Note that ImaqSession.Attributes is _not_ sufficient for what I need.   I need to use camera-specific attributes, which are not accessable via that collection.

 

Thanks for your time,

 

Gabriel

0 Kudos
Message 1 of 5
(4,391 Views)
Solution
Accepted by topic author Gabriel-r
Ah, nevermind, I missed Session.Attributes.SetCameraAttribute().  Will try that one out.
0 Kudos
Message 2 of 5
(4,389 Views)
Can you point me to the documentation for the C#/.net API for Vision.Acquisition.Imaq namespace?
0 Kudos
Message 3 of 5
(4,251 Views)

It might depend on what version of Visual Studio & NI Vision you have installed, but on my computer, the VS2008 Documentation has the Imaq classes at:

 

ms-help://MS.VSCC.v90/MS.VSIPCC.v90/NI.MeasurementStudio.2008/NINETIMAQ/html/NationalInstruments.Vision.Acquisition.Imaq.html

 

Putting URL that into Internet Explorer 8 also works.

0 Kudos
Message 4 of 5
(4,249 Views)
Great! Thanks.
0 Kudos
Message 5 of 5
(4,247 Views)