ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to create a Generic list .NET input

I am trying to create a valid input sequence that is a generic list of bytes.  As a system.collections.generic.list constructor does not exist in labview I am looking for ways to create this input.  As it is an input sequece of bytes I need it to be a control. Can any one assist.

 

view1.PNG

0 Kudos
Message 1 of 5
(4,285 Views)
You'll need to provide more information as to exactly what you're trying to use this for, since from the little you've posted I can't see why a simple array of U8 integers won't do what you need.
0 Kudos
Message 2 of 5
(4,279 Views)

 Apologies for the lack of detail this is my first time working with .net though labview. 

A simple array of U8 integers results in an broken wire.  The input type is listed as a .NET refnum. 

I have tried the following two workarounds with no success:

1. Using type cast with the appropriate .net refnum-> Labview is happy, in that I dont get an unbroken wire, however the .net engine throws an exception

2. Using the "to .net obj":  from the .net pallet to turn the array of bytes into a .net object. 

 

  

view2.PNG

Message Edited by channel_72 on 11-10-2009 10:27 AM
0 Kudos
Message 3 of 5
(4,276 Views)
So is "UserInterface" a class from a private assembly? Is "inputStream" supposed to be of a System.Collections.Generic.List type? If so, you cannot directly create that class in LabVIEW, but you can do it using reflection. See here for an example.
0 Kudos
Message 4 of 5
(4,267 Views)
I couldn't dig this up at the time of my response, but there's also an example of using reflection that I had posted a while ago here.
0 Kudos
Message 5 of 5
(4,242 Views)