LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

'.NET Object to Variant.vi' Cannot Handle 2D Arrays

The range I am looking for is A1:AO414. I have checked and this seems right. It will open in Active X using this range. I can use a single cell A1 and I get data back just not with a range. Is my format correct for .net? A1:AO414

Tim
GHSP
0 Kudos
Message 11 of 27
(243 Views)

@aeastet wrote:

The range I am looking for is A1:AO414. I have checked and this seems right. It will open in Active X using this range. I can use a single cell A1 and I get data back just not with a range. Is my format correct for .net? A1:AO414


Are you sure cell2 needs to be "missing"?

 

In AX, you leave it unwired. Why not leave it unwired in .NET?

 

Can you post a SSCCE?

0 Kudos
Message 12 of 27
(216 Views)

If you do not connect the missing you get an error out of the get_Range function. I worked on this for hours yesterday. It seems that the ".net to variant" does not know how to interpret the response from the get_Range function. I am able to get other values from the same connection but not get_Range. I can also get a single value. I also found that I could not get column number and row number. It seems that NI only took this development so far and decided that it was worth the effort.

 

When you open the workbook you can also not leave everything unwired like you did in active X. I found the only way to get the workbook open is to connect all of the input to the property node. .net seems to be different and requires more care than active X did.

You said that you had something that worked in the second post. Can you share?

 

What is a SSCCE?

Tim
GHSP
0 Kudos
Message 13 of 27
(200 Views)

@aeastet wrote:

What is a SSCCE?


I think SSCCE means "Short, Self Contained, Correct (Compilable), Example"

https://www.abbreviations.com/SSCCE 

 

Message 14 of 27
(189 Views)

Just one comment, make sure that you close the .net references after you have converted the value. 

0 Kudos
Message 15 of 27
(176 Views)

@aeastet wrote:

You said that you had something that worked in the second post. Can you share?


2D Array To Variant.png

😉

 

The object you get is probably not a 2D array but some other class that .NET (or C#) treats as a 2D Array transparently.

 

I do read Excel, but either through OOXML or ADO (SQL). So my solutions won't match.

 

You'd probably be able to create one of those objects in a blanc VI, and make a SSCCE... It would eliminate every confusion about what exactly we're talking about.

Message 16 of 27
(154 Views)

aeastet_0-1751550093956.png

 

Tim
GHSP
0 Kudos
Message 17 of 27
(146 Views)

@aeastet wrote:

aeastet_0-1751550093956.png

 


Is the Page index ever different from 'i' in this case?

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 18 of 27
(141 Views)

I have tried outputting the variant data in many different ways. 1D variant array, 2D string array, 2D double array, 1D string array, 2D variant array. No matter what I give it I get void unless I ask for only one cell. Then I get a string out with the value. 

Tim
GHSP
0 Kudos
Message 19 of 27
(140 Views)

No I am getting the correct data in some of the other vi's in the for loop. I know that I am on the correct sheet. I verified that I am getting good references from the .net. There is no errors in the .net property or invoke nodes. The give good references. It just seems that the .net to variant does not know what to do with the data.

Tim
GHSP
0 Kudos
Message 20 of 27
(138 Views)