LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Pass 2D array from LabVIEW to C# problem

Hi , I have made a dll using .net assembly to use my labview code in c# . I can easily pass string , numerical and 1D arrays from labview to c# and vice versa, but when I want to read back 2D U16 array from Labview in c# I get the following exception although they have exactly the same type (ushort)

Cannot widen from source type to target type either because the source type is a not a primitive type or the conversion cannot be accomplished.

Could you please let me know how should I pass 2d array from labview to c#
Thanks
0 Kudos
Message 1 of 6
(3,597 Views)

Hi Dennis , that problem is fixed( it was not actaully related to data transfer between c# and LabVIEW) but I have problem in passing 2D arrays

The formats are exactly the same but I get this exception in c#

Since the topic was different I thought it is better to create a new topic

 

I would greatly appreciate any help on this?

 

0 Kudos
Message 3 of 6
(3,574 Views)

If all else fails, you could pass n 1D arrays across and then put the original 2D array back together. That's probably how the computer would do it behind the scenes, anyway.

 

Cameron

 

To err is human, but to really foul it up requires a computer.
The optimist believes we are in the best of all possible worlds - the pessimist fears this is true.
Profanity is the one language all programmers know best.
An expert is someone who has made all the possible mistakes.

To learn something about LabVIEW at no extra cost, work the online LabVIEW tutorial(s):

LabVIEW Unit 1 - Getting Started</ a>
Learn to Use LabVIEW with MyDAQ</ a>
0 Kudos
Message 4 of 6
(3,549 Views)

conversion from string to number is not that important, I can do it later. My problem is right now how to split the string( every 8 chars or every 4 chars) and insert them in the next columns ( the same row). Can you help me to do this?

I tried using split string but then how can I move it to the next cube?

0 Kudos
Message 5 of 6
(3,531 Views)

@tintin_99 wrote:

conversion from string to number is not that important, I can do it later. My problem is right now how to split the string( every 8 chars or every 4 chars) and insert them in the next columns ( the same row). Can you help me to do this?

I tried using split string but then how can I move it to the next cube?


For this one, stick to your original thread

We've given you some suggestions. Show some effort and we'll help you along.

0 Kudos
Message 6 of 6
(3,522 Views)