LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Using dynamically allocated 2d arrays with Array functions (e.g. PlotIntensity)

Hello--
I have a relatively simple problem.  I would like to use dynamically allocated 2d arrays in a given Labwindows/CVI program, and I would like to use these arrays with some of the built-in array functions contained in the library.  Most notably, I would like to use the PlotIntensity function to visualize these 2d arrays. 

The first problem I encountered was the run-time checking error (which says the input array is too small), but I think I was able to get past that by disabling the run time checking.  However, the results still appear strange.   I seem to have no problem using the function with static arrays, but the results look strange when I use dynamically allocated (pointers to pointers) arrays.

My question is this:  is it possible to use dynamically allocated 2d arrays with functions such as PlotIntensity?  If not, is there a way around the problem?  Perhaps I am missing something very simple.

Thanks in advance.
0 Kudos
Message 1 of 3
(3,054 Views)
Hello.

Yes, you can use dynamically allocated arrays. Look at the replies by LuisG and Alex D, here and here.

If you like, you could allocate your 2D array to hold all your data, plot it once using PlotIntensity() or PlotScaledIntensity(), then zoom & pan with the mouse or by calling SetAxisScalingMode().

Regards,
Colin.

0 Kudos
Message 2 of 3
(3,037 Views)
Thank you, Colin, for pointing me in the right direction.  I will take a look at these.  I appreciate the help.
0 Kudos
Message 3 of 3
(3,025 Views)