LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Kinect One - Creating a list in .NET

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);
 
Unfortunately Labview doesn't seem to allow for creation of generic lists easily using .net, so I've been trying to do a workaround but I can't seem to get it to work. Unfortunately because of the alpha stage of the Kinect One I cannot share the .dll which makes answering this a bit harder. The underlying code and the errors are shown in the following image:
Kinect One Body Errors.png
If anyone could provide me with any help that would be greatly appreciated!
 
Thanks
 
Ross
0 Kudos
Message 1 of 8
(2,731 Views)

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, 

Luis J.
Applications Engineer
National Instruments
0 Kudos
Message 2 of 8
(2,694 Views)

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

0 Kudos
Message 3 of 8
(2,679 Views)

Greetings ross_36

 

I found an interesting article that will be of use to you.

 

Have a nice day.

Luis J.
Applications Engineer
National Instruments
0 Kudos
Message 4 of 8
(2,658 Views)

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

0 Kudos
Message 5 of 8
(2,593 Views)

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.

0 Kudos
Message 6 of 8
(2,588 Views)

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"

0 Kudos
Message 7 of 8
(2,583 Views)

Greetings DAckermann

 

Where do you get this error? Could you give us more details on how is this happening? On the mean time, perhaps these links may be of help.

 

Warm Regards, 

Luis J.
Applications Engineer
National Instruments
0 Kudos
Message 8 of 8
(2,566 Views)