03-17-2014 02:41 AM - edited 03-17-2014 02:42 AM
Hi everyone,
I've been lucky (unlucky) enough to be signed on to the Kinect One Alpha SDK, and it's been both great and frustrating. I've been banging my head against a wall for days now trying to figure out how to create a list in Labview to replicate c# code. The c# code looks like this:
// Allocate Bodies array
_bodies =
new
Body[_kinect.BodyFrameSource.BodyCount];
// Aquire body data
frame.GetAndRefreshBodyData(_bodies);
03-17-2014 03:35 PM
Greetings ross_36
There are a number of reasons why error 1172 may appear in LabVIEW. This is because any exception thrown while calling a .NET is interpreted in LabVIEW as Error 1172.
To resolve this error in LabVIEW, try the following:
Ensure you're building your assembly as well as all other libraries in "release" mode ("debug" releases are typically linking additional references and .NET components which are not present on computers where MS Visual Studio is not present).
If your assembly calls another C++ ensure you have installed Visual C++ Redistributable for Visual Studio 20xx before attempting to run.
You may be able to call .NET assemblies correctly if they are saved in the root directory of the top-level VI.
Let us know if you need additional help. Have a nice day.
Warm Regards,
03-17-2014 07:30 PM
Thanks for the response Luis,
The DLL file is acually built by Microsoft, so I don't have any control of it. I also have up to date Visual Basic, C++ etc installed so unfortunately that wasn't an easy fix either. I tried shifting the mscorlib dll to the same folder as the VI, but this didn't work.
The issue from what I can see is that Labview doesn't use generic objects like the list I'm trying to create, so I'll need to figure out a workaround.
Any other help would be greatly appreciated!
Ross
03-18-2014 05:32 PM
Greetings ross_36
I found an interesting article that will be of use to you.
Have a nice day.
03-30-2014 04:08 AM
Hello Ross,
I am having exactly the same problem with a list type in a .NET assambly. The "GetType" call has no error, but the reference coming from the call is null.
Did you find a solution for this?
Kind regards
Dermot
03-30-2014 04:37 AM
Oh, it works.
I was looking at creating an instance of that type as a single problem extracted from the whole code.
When I run that code in the complete project, it works. It seems other classes have to be instanciated before.
03-30-2014 05:10 AM
Ok, next problem..
I was trying the same thing with another type of the assembly and get the following error from Activator.createInstance()
"It is not possible to construct an instance of an abstract class"
03-31-2014 10:10 AM