Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

Required library for acquiring images in Visual Studio?

I am trying using to use Visual Studio (2010 or 2017) C# to run a GigE camera to grab an image and run some compare function set up in NI Vision Development Module and Vision Assistant 2017. I added all the references from the NI folders but I seem to be missing the sessions one? Which reference should be the one that works?

 

The session is set up using:

 

            NationalInstruments.Vision.Acquisition.Imaqdx.ImaqdxSession session;
            session = new ImaqdxSession(comboBoxCameraName.Text);
            session.ConfigureGrab();
 
            uint bufNum = 0;           
 
            NationalInstruments.Vision.VisionImage img; // reference ?
            session.Grab(img, true, out bufNum);
            session.Close();
 
and it returns the following error:
Error 1 The type 'NationalInstruments.ISupportSynchronizationContext' is defined in an assembly that is not referenced. You must add a reference to assembly 'NationalInstruments.Common, Version=8.7.35.131, Culture=neutral, PublicKeyToken=18cbae0f9955702a'. G:\2817\Test2018\NItest\NI_Test\NI_Test\Form1.cs 17
 
0 Kudos
Message 1 of 2
(2,063 Views)

Hi Dan,

 

Please note that, according to the Readme, Visual Studio 2010 and later are not officially supported:

 

NI Vision Acquisition Software Readme
http://download.ni.com/support/softlib//vision/Vision%20Acquisition%20Software/January%202017/Vision...

 

That said, you could try the steps in the following KB if you think this issue is related. Howebver, I think the lack of support for Visual Studio is the more likely cause.

 

Building a Measurement Studio Project in Visual Studio Results in Assembly Conflicts
https://knowledge.ni.com/KnowledgeArticleDetails?id=kA00Z000000kGvFSAU

0 Kudos
Message 2 of 2
(2,031 Views)