12-21-2015 04:41 AM
Hi, we are also using array's of double (Foo) in Labview generated dll, and ran into the same problem when building in VS2015 and referencing the dll.
VS2015
Error CS0570 'Foo' is not supported by the language.
I installed VS2015 update 1, and instead I get this error.
Error CS0029 Cannot implicitly convert type 'double[*]' to 'double[]'
12-21-2015 04:53 AM
Hi Magnux,
Yes, the VS2015 update makes VS to recognize the array properly, now the problem is on LabView, that is doing an multidimension array from a single dimension array.
No idea that this is going to change in the near future, I have contacted NI support, and this was their answer:
The way LabVIEW handles arrays is not anything that can easily be changed and
it would most probably have severe implications. The LabVIEW part is not
broken, it just treats a one dimensional array as a multidimensional array of
rank one, and this is causing the latest version of VS to misinterpret the data
type.
The best for you ( and what I did, is to get the workarround). make labview use multi-dimension arrays so you can send and receive arrays from labview, then use as multidimensions in VS2015.
12-21-2015 06:43 AM
Thanks JOSEALB85, we'll look into using your suggested workaround!
Is there an official support ticket for this issue that I can upvote? 🙂
Otherwise, I'll try to post a new ticket to NI support regarding the array problem.
Merry Christmas!
/Magnus
12-21-2015 06:48 AM
Yes, I have been exchanging emails with Anton Sundqvist, and the support reference is Reference#7440462.
Maybe if we add some pressure they will fix it some day.
12-21-2015 09:11 AM
Thanks, we have now also added a ticket with a reference to yours as well.
11-26-2017 07:44 PM
Hello,
I am getting this same error while passing an array from C# to a LabVIEW Interop assembly. Has anyone found a solution or fix to this?
The Interop signature looks like this
void CFit(Array Input__32Array, out Array Output__32Array, out Array Result__32Array)
When I try to pass an array VS2015 throws an error:
Error CS1503 Argument 1: cannot convert from 'Reflex_UI.iData[]' to 'Reflex.CFit.Input__32Array__32[]*
IData is defined in C# with the following
[StructLayout(LayoutKind.Sequential, Pack = 0)] public class IData { [MarshalAs(UnmanagedType.R4)] public float L; [MarshalAs(UnmanagedType.I4)] public int D; [MarshalAs(UnmanagedType.R4)] public float S; [MarshalAs(UnmanagedType.I2)] public short I; [MarshalAs(UnmanagedType.I2)] public short C; }
Thanks in advance.
06-20-2018 01:45 PM
Looks like we have to make change on LabVIEW side.
Please check the link below.
https://knowledge.ni.com/KnowledgeArticleDetails?id=kA00Z0000019LNISA2