LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

.NET Byte array reference parameter ?

Hi all,

I use LabVIEW 7.1 to call a method from a .NET assembly.
I have some difficulties to use a method with a "ref byte[]"
parameter.
LabView shows me the parameter as a "System.Byte[]&".
I created a 1D array of System.Byte, then "Type cast" it into
"System.Byte[]&" but at the execution I got a null value.
I createad also a 1D array of I8 (System.Byte representation) with
same result.

If someone has an idea.

Thank you.
Sebastien
0 Kudos
Message 1 of 3
(3,208 Views)
Sebastien,

There shouldn't be a reason to type cast at all in this case. You should just be able to create your 1D array of I8 and wire that directly into your invoke method. You will then need to wire something to the output to ensure that you get the post-execution value of the variable. This should work for you.

Regards,

Adam B.
Applications Engineer
National Instruments
0 Kudos
Message 2 of 3
(3,208 Views)
Hi,

Thanks for your response.
> There shouldn't be a reason to type cast at all in this case. You
> should just be able to create your 1D array of I8 and wire that
> directly into your invoke method. You will then need to wire
> something to the output to ensure that you get the post-execution
> value of the variable. This should work for you.
I tried first your solution but I've got this error message:
"
You have connected two terminals of different types.

These cannot be wired together because their data types (numeric,
string, array, cluster, etc.) do not match. Show the Context Help
window to see what data type is required.
The type of the source is 1-D array of byte [8-bit integer (-128 to
127)].
The type of the sink is .NET Refnum.
"

The parameter
is a reference of byte array ("System.Byte[]&")
But we'll update the .NET API to have only a byte array
("Systel.Byte[]") as parameter, not a reference. It works well like
that.

If you have another idea ?


Thanks
Sébastien FUSILIER
Freescale Semiconductor
0 Kudos
Message 3 of 3
(3,208 Views)