Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Where can i find C#-function-names for NI Vision-project

Solved!
Go to solution

Hello,

i created a working project in NI Vision Assistant 8.5 and now i want to do the same as DLL in C#

The only problem is where to find the function names that i gave to use.

Currently i´m doing:

1. Extract HSL - Saturation

2. Threshold

3. Image Mask from ROI

4. Circle Detection

 

The circle detection returns x,y,radius which i use to select pixels in original image.

5. From these pixels i need to get RGB-values and luminance

 

 Can someone help me to find the correct C#-commands or tell me where to find them.

 

Thanks for your help

best regards

0 Kudos
Message 1 of 7
(5,390 Views)

Hi there,

 

When you go to Start -> Programs -> National Instruments -> NI Vision -> Documentation

you will find the VDM_VB_User_Manual.PDF where you will find a list of functions in different

categories. Give it a try and let me know if you could find the functions that you needed.

 

Best regards,

David

0 Kudos
Message 2 of 7
(5,374 Views)

Thanks David.

 

I find that there are two librarys. For my understanding one is for ActiveX control (axCWIMAQ...) and one is normal(?)(CWIMAQ)

 

I wanted to packing all my functions like loadImage, ShowImage, ProcessImage, etc. into a c#.net dll for Labview. I am new in C#. what i did currently is put a ActiveX control in my Form can use the axCWIMAQVision and axCWIMAQViewer to access the image functions.

My problem was calling a ActiveX dll in Labview is always failed. Besides I found the CWIMAQVision and CWIMAQViewer and i though maybe they dont need ActiveX control and still do the same things(?).

 

Then problem came out again.

For example:  To load image from hard disk. 

For ActiveX control, I use -> axCWIMAQVison.ReadImage(axCWIMAQViewer.Image,"C:\\temp.bmp",axCWIMAQViewer.Palette);, which is doing fine.

When i use ->

NationalInstruments.CWIMAQControls.CWIMAQImage m_Image = new NationalInstruments.CWIMAQControls.CWIMAQImage();
NationalInstruments.CWIMAQControls.CWIMAQVisionClass m_Vision = new NationalInstruments.CWIMAQControls.CWIMAQVisionClass();
NationalInstruments.CWIMAQControls.CWIMAQViewerClass m_Viewer = new NationalInstruments.CWIMAQControls.CWIMAQViewerClass();
 

CWIMAQVison.ReadImage(m_Image,"C:\\temp.bmp",CWIMAQViewer.Palette); which is not working any more.

 

 I guess the problem is that there is not a  "CWIMAQViewer" existed, so i cant access to the Palette?

 

anyone can help me with this question?

 

and if possible, how can i call a ActiveX control .net dll in labview ?

 

best regards.

 

 

0 Kudos
Message 3 of 7
(5,356 Views)
Solution
Accepted by topic author newuser12342

Hi there,

 

I found an article that discusses errors that can occur when you try to use CWIMAQ controls in your .NET application:

 

http://digital.ni.com/public.nsf/allkb/C3E2D0E6DD034708862572A00077B625?OpenDocument

 

I would also try to search the cwimaq.HTML file that is located in the documentation folder of NI-Vision that I recommended you last time.

I am sure that you will find the functions that you are looking for there.

Let me know if this worked.

 

Best regards,

David

Message 4 of 7
(5,349 Views)

Hi  David,

 

Thanks again, that makes a lot of sense.

 

When I put the .net component on my Form and add a ShowForm() function in my exported class (C#.net dll). Then I try to call the ShowForm() function in C# and in Labview. It doesnt work both ways. The Error Msg is: "The ActiveX-Control adbf7240-2b8d-11d1-b5c5-00a024d63828 cannot instantiate, the current Thread is not Singlethread-Apartment."

 

Can you tell me what is this problem mean? 

0 Kudos
Message 5 of 7
(5,342 Views)

I thought it might be the .net problem then. I will repost it to the .net language forum.

 

Thanks David.

0 Kudos
Message 6 of 7
(5,321 Views)
 
0 Kudos
Message 7 of 7
(5,036 Views)