LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to use a .NET DLL that includes Object with Generic parameters


Using theCall Library was going to be my next question....

Which is?

Back to the .NET wrappers....  have you ever had a .NET Constructor working then saved and exited the app the upon reopening it the public
constructors were no longer available? 
 
This has happened a couple times with different .NET Wrappers.  If so what did you have to do to get things working again?
 
I have had some luck just basically fiddling but have never been able to nail a good solution.

The only thing I can think of is that the .NET runtime is unable to find a dependent assembly. If your .NET assembly references another .NET assembly then the .NET runtime needs to be able to find it. If it can't find it, then the assembly won't work. The best way to deal with this is the have the dependent assemblies in the same folder as the wrapper assembly. You can take a look at the article How LabVIEW Locates .NET Assemblies for more information.


Is there a way to have a path converted to a .NET refnum?


I don't really understand what this means. There is no "refnum" class.
0 Kudos
Message 11 of 20
(2,386 Views)

The .NET wrapper has an input called "Image"  This input wants a .NET Refnum.  But looking at the library itself it appears

to need path to the image file. So I was going to see if I could convert a path to a .NET Refnum and wire it to the image input.

1:30 Seconds ARRRGHHH!!!! I want my popcorn NOW! Isn't there anything faster than a microwave!
0 Kudos
Message 12 of 20
(2,383 Views)
I had ran into the intermiting wrapper issue before and adding everything to a project seemed to help too....
1:30 Seconds ARRRGHHH!!!! I want my popcorn NOW! Isn't there anything faster than a microwave!
0 Kudos
Message 13 of 20
(2,378 Views)

The .NET wrapper has an input called "Image"  This input wants a .NET Refnum.  But looking at the library itself it appears
to need path to the image file. So I was going to see if I could convert a path to a .NET Refnum and wire it to the image input.


The method actually needs a .NET class, so you have to instantiate a class or call a method that returns the appropriate class. Can you provide a link to the online page to the method (or at least the namespace->class->method) that you're referring to? I am not familiar with this library.
0 Kudos
Message 14 of 20
(2,370 Views)
 
Emgu.CV  -> Image <TColor, TDepth>(String)  appears to be the required hook to get an image...
 
But none of the image parameters are public.
 
Does this mean the Call Library Node is an easier approach?     Perhaps using a CIN linked to the correct openCV DLL
with TColor, TDepth, and String as inputs...... but what would the output be if the output is expected to be a picture?
 
 
1:30 Seconds ARRRGHHH!!!! I want my popcorn NOW! Isn't there anything faster than a microwave!
0 Kudos
Message 15 of 20
(2,367 Views)
That is the constructor for the Image class in that namespace. This constructor uses generics, and, as I noted, as far as I know the LabVIEW <--> .NET interface still does not handle generics. This means that none of the constructors for that class would be visible.

You also need to make sure you use proper terminology. The "item" that you're referring to is a constructor, not a hook. There are no image "parameters". Those are all constructors.

The Call Library Function and CIN are two totally different things. Neither of those can be used to call .NET assemblies. I wasn't suggesting to use Call Library Function to call this .NET assembly. I was suggesting to use Call Library Function with the original OpenCV library since the emgu library is just a .NET wrapper around the OpenCV library. If you can't use the emgu .NET library from LabVIEW, then you need to see if you can use the original OpenCV library. You would be able to do this if a DLL is provided for that library. Unfortunately, this will be considerably more complicated. As I also pointed out, your other recourse is to write your own .NET wrapper around the emgu .NET library.
0 Kudos
Message 16 of 20
(2,364 Views)

Sorry for the language barrier on the terms as you can probly tell I am muttling my way through this exercise. 

I am on the same page with you as far as using the Call Library Function Node,  my question regrding that is what type of output would be required?

 

 

1:30 Seconds ARRRGHHH!!!! I want my popcorn NOW! Isn't there anything faster than a microwave!
0 Kudos
Message 17 of 20
(2,350 Views)
That is completely dependent on the function that you're calling. The node simply calls a DLL function. The function's prototype will fully define the inputs and return value. You should peruse the chapter in the LabVIEW Help on calling external code using the Call Library Function function. There is also an extensive example that ships with LabVIEW. Search for "dll". The example is called "Call DLL".
0 Kudos
Message 18 of 20
(2,333 Views)

I found the LV document "Calling External Code"  I am going to work through the examples and then pick this endevor back up....

 

Thanks for your help so far.

1:30 Seconds ARRRGHHH!!!! I want my popcorn NOW! Isn't there anything faster than a microwave!
0 Kudos
Message 19 of 20
(2,331 Views)
Sorry, it was called "Using External Code in LabView".....
1:30 Seconds ARRRGHHH!!!! I want my popcorn NOW! Isn't there anything faster than a microwave!
0 Kudos
Message 20 of 20
(2,330 Views)