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.

LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Using PlotIntensity with dynamically allocated arrays

Is there a way to use the PlotIntensity function with an array that has been dynamically allocated somewhere in the program using calloc? Or must I specify the size of the array when I declare it? The reason I ask is because I don't know how big the array is going to be until I get some information from the user and it will be different every time.

Thanks in advance.
0 Kudos
Message 1 of 3
(2,857 Views)
Sure, you can pass any pointer into the PlotIntensity function. You just have to know the sizes it was allocated to and pass them in as well so the function knows how to read the data from the pointer. See the example cvi\samples\userint\intgraph.prj. It uses a dynamically allocated buffer.

Best Regards,

Chris Matthews
National Instruments
0 Kudos
Message 2 of 3
(2,857 Views)
Dear Chris Matthews,

Thank you for your reply. I checked out that sample program and tried writing my own version and it worked beautifully! Thanks again!
--Marianne
0 Kudos
Message 3 of 3
(2,857 Views)