LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Call library function- memory allocation

Solved!
Go to solution

Hi,

 

I want to call a dll from LabVIEW and one of the inputs expects a pointer to double (double*). I have done things like this before and use create array to allocate the memory in LabVIEW to pass to the dll. This time what is expected is a pointer to a single double. Can I just wire a diagram numeric double to the input or will this not actually allocate memory?

0 Kudos
Message 1 of 4
(2,273 Views)
Solution
Accepted by topic author ToeCutter

ToeCutter wrote:

I want to call a dll from LabVIEW and one of the inputs expects a pointer to double (double*). I have done things like this before and use create array to allocate the memory in LabVIEW to pass to the dll. This time what is expected is a pointer to a single double. Can I just wire a diagram numeric double to the input or will this not actually allocate memory?


It would be better to wire a single instead of a double, but other than that(oops, misread "single double" as "single"), yes, it will correctly allocate memory. You just need to configure the parameter as a single double passed by pointer.

Message 2 of 4
(2,270 Views)

Thanks, but why would I pass a single when the function expects a double??

 

[edit]I see the confusion now- by 'single double' I mean the function expects a pointer that points to exactly one instance of a double, rather than the first element of an array.

0 Kudos
Message 3 of 4
(2,267 Views)

Oh, sorry, misread "pointer to a single double" as "pointer to a single." Ignore that part of my comment and wire in a double.

0 Kudos
Message 4 of 4
(2,264 Views)