10-30-2008 12:12 PM
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
Solved! Go to Solution.
10-31-2008 07:58 AM
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
11-03-2008 03:41 AM
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.
11-03-2008 04:28 AM
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
11-03-2008 05:22 AM
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?
11-04-2008 03:02 AM
I thought it might be the .net problem then. I will repost it to the .net language forum.
Thanks David.
01-27-2009 07:01 AM