Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Can't create interop assembly with images as parameters

Hello,

I'm trying to create an "assembly interop.net " that contains imaq functions. This dll will be called from a c#.net application .

I've managed to do an "assembly interop.net" dll before that takes clusters in parameters, and it worked perfectly. But now when I try to pass images as parameters,

The images is interpreted as a "Refnum" type (I don't know what data type is that ). and when I try to build the dll I got this error message:

 

L'erreur -2628 s'est produite à : Nœud de méthode dans DatatypeXML_From_Control.vi->AB_ExportedAssemblyVI_Define_VI_Prototype.vi->AB_InteropAssembly.lvclass:Open_Top_Level_VIs.vi->AB_Build.lvclass:Build.vi->AB_Application.lvclass:Build.vi->AB_InteropAssembly.lvclass:Build.vi->AB_Build.lvclass:Build_from_Wizard.vi->AB_UI_Frmwk_Build.lvclass:Build.vi->AB_UI_FRAMEWORK.vi->AB_CreateNewWizard_Invoke_CORE.vi->ABUIP_CreateNewWizard_Invoke.vi->ABUIP_CreateNewWizard_Invoke.vi.ProxyCaller

Raisons possibles :

LabVIEW: Une erreur s'est produite lors de l'analyse du document.

 

Please tell me if you have any idea about this subject.

 

0 Kudos
Message 1 of 3
(3,947 Views)

If you need the image data, you need to convert the image to an array.  The purple wires in LV are mearly pointers to memory.  They do not contain image data in them.  Converting the image to an array also insures that a race condition does not inadvertantly alter the image before you have a chance to process, or display it, if some other functions are acting on the image pointed to by the reference.

Machine Vision, Robotics, Embedded Systems, Surveillance

www.movimed.com - Custom Imaging Solutions
0 Kudos
Message 2 of 3
(3,940 Views)

Hello, and thanks for your help,

I actually managed to make the dll and call it from c#. But the problem is I don't know how to reference an image from labview to c#.

As I have understand this type (NationalInstruments.Labview.Refnum.LVBaserefnum) is the equivalent of image class in c# but I didn't accept it when I pass an image object insteat of LVBaserfnum object)

So Can you tell me how can I convert the LVBaserefnum type to an image class?

Thanks again

0 Kudos
Message 3 of 3
(3,929 Views)