Gustavo Monteiro Posted July 17, 2008 Report Share Posted July 17, 2008 Hi everybody, I created a C# DLL has a Class named "ClasseDadosPontos". A labview dll. In this dll I need to manipulate the class "ClasseDadosPontos". In another C# dll I need to call the labview dll passing by parameter the "ClassDadosPontos". But allways i tried to call this, "ClasseDadosPontos" return a erro that says .NET Refnum is null!!! Thanks for your help Gustavo Quote Link to comment
MikaelH Posted July 17, 2008 Report Share Posted July 17, 2008 Hi Gustavo I've created dot net code that I call from LabVIEW without any problem, I also got the dot net code to invoke a VI when special event happens that the dot net code is controlling. I don't really understand what you are trying to achieve. But just to be sure, have you opened/called a constructor of the dot net class before you used it? You can create several constructors for a dot net class, the constructor in the example below takes 3 arguments. Cheers, Mikael Quote Link to comment
Godpheray Posted July 18, 2008 Report Share Posted July 18, 2008 I think a .NET Constructor Node is needed to get a valid .NET Refnum for your "ClasseDadosPontos". Here is more information about the .NET constructor Node. http://zone.ni.com/reference/en-XX/help/37...nstructor_node/ Quote Link to comment
Gustavo Monteiro Posted July 18, 2008 Author Report Share Posted July 18, 2008 Hi Mikael, I'm seendig a new picture of my process, i need to send my object "ClasseDadosPontos" from my C# application to labview dll. and labview will process the data and return to C# application a value. I made as you said but i don't need to create a instance in labview a need to send the instance from C#. I created a text file to return the error, and the returned error was: Status: 1 Code: 1 Source: Property Node in Tempo.vi->Tempo.vi.ProxyCaller But I don't know what this mean!!! Cheers, Gustavo Quote Link to comment
Yair Posted July 18, 2008 Report Share Posted July 18, 2008 I'm not sure you can pass a .NET refnum across a DLL boundary like that. If I'm not mistaken, .NET references are only valid within the appdomain which created them, but you should verify that. What you might want to do is call the .NET code inside the C# application and only transfer the simple values. Quote Link to comment
Gustavo Monteiro Posted July 18, 2008 Author Report Share Posted July 18, 2008 QUOTE (Yair @ Jul 17 2008, 02:05 PM) I'm not sure you can pass a .NET refnum across a DLL boundary like that. If I'm not mistaken, .NET references are only valid within the appdomain which created them, but you should verify that.What you might want to do is call the .NET code inside the C# application and only transfer the simple values. I need to pass like that because, this is just a test, I will need to pass an array of that object, with about 100000 os elements, if I pass this one by one it ill be very slow. Thanks Quote Link to comment
Yair Posted July 19, 2008 Report Share Posted July 19, 2008 You might be able to do this using remoting, but I'm not a .NET programmer, so I'm not familiar with the details. Personally, I'm not at all sure it would work with LabVIEW, but you can try checking the details. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.