LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

2D double array shared variable in real-time application

Hi,
 
I am using Labview 8 and I created a real-time application using shared variables. Is it possible to create a 2D array of double (I don't find how to do itdirectly). Probably I can define my own control and load this control as the custom data type of my variable. But is it recommended to do that?
 
Thank you
Alexandre Boyer
0 Kudos
Message 1 of 3
(5,240 Views)

I don't have LV 8 but may still have a tip that's fresh in mind from a different post I just made.  If 2D dbl isn't available, you could use the "Reshape Array" function to turn it into a 1D array on one side and similarly reshape it back to 2D on the other side.  As long as the total # of elements specified by the 2D shape and the 1D shape are the same, no actual memory allocation is done and there should be very little overhead to the "reshaping".

-Kevin P.

ALERT! LabVIEW's subscription-only policy came to an end (finally!). Unfortunately, pricing favors the captured and committed over new adopters -- so tread carefully.
Message 2 of 3
(5,232 Views)

Another way to do this is to specify your shared variable to be a custom control and create a control that simply has a 2-D array in it.  I've attached a zipped LabVIEW 8.2 project that shows both methods.  Enjoy!

Becky

Becky Linton
Field Engineer - Michigan
National Instruments
Message 3 of 3
(5,045 Views)