From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

"new byte" conversion from .net into Labview

Hello,

 

I'm currently working on a Labview / .net program which involves copying c# code and making it usable in Labview.

 

I'm stuck trying to convert three numbers (A,B,C) into a 1D array, and keep coming up with an error. I'm using build array for each of the elements to get the 1D array, but I'm sure I must be doing something wrong. The code looks like:

 

new byte[A * B * C]

 

The three numbers are in the format of long 32-bite intergers, but the input for the reference is unsigned 8-bit integer.

 

If anyone could help me figure out what I'm doing wrong it would be greatly appreciated.

 

Thanks

 

Ross

0 Kudos
Message 1 of 3
(2,200 Views)

Actually, if I'm not mistaken, this simply allocates a byte array of A * B * C elements. So the LabVIEW equivalent would be to create the product of A * B * C and simply wire this number to the Initialize Array node.

Rolf Kalbermatter
My Blog
Message 2 of 3
(2,188 Views)

Thanks a lot Rolf - my program is now up and running!

0 Kudos
Message 3 of 3
(2,154 Views)