LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Having Issue with Array Resizing

I am working with a LabVIEW-Python interface, using a LabVIEW DLL to perform operations called from Python via the cffi library. Memory allocation occurs before passing the inputs to the DLL, and resizing happens after the DLL processing completes. Both operations are handled within the Python script using LabVIEW's internal Array Resize function.
 
However, resizing the array to 0 elements does not work. When I attempted to use the DSDisposeHandle (DeAllocate) function instead, it caused a crash, which is why I reverted to using the Resize function with a size of 0. I am using LabVIEW 2021 SP1 (64-bit). I want to understand why resizing to 0 fails. Is this behavior intended by design in the LabVIEW memory manager, or am I implementing it incorrectly?
0 Kudos
Message 1 of 3
(87 Views)

Hi Dhatshayini,

 


@Dhatshayini wrote:
am I implementing it incorrectly?

How exactly did you implement "it"? Mind to share some code?

 

The ReshapeArray works as expected in LabVIEW:

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 3
(78 Views)

You need to show what you did. Memory management of LabVIEW data is not just something you can vibe code. This listens very closely and there is more to it than just calling some function randomly.

 


@Dhatshayini wrote:
I want to understand why resizing to 0 fails. Is this behavior intended by design in the LabVIEW memory manager, or am I implementing it incorrectly?

YES the LabVIEW Memory Manager definitely can do this and YES you are implementing something wrong. But without looking at the actual code both for your LabVIEW DLL and the Python FFI interface, we can only say these two things.

Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
0 Kudos
Message 3 of 3
(33 Views)