From Saturday, Nov 23rd 7:00 PM CST - Sunday, Nov 24th 7:45 AM CST, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

use call library function to return a 1D array

Solved!
Go to solution

Hi, I want to use Labview to receive a 1D array from a dll. I can find the "array Data Pointer" in the input settings, but in the "return type" I could not find the array option. So how should I do to return the 1D array?

 

Capture.PNG

0 Kudos
Message 1 of 7
(4,162 Views)

It does not return array directly, only pointers in parameters.

Connect array to the parameter input, it will be filled on the output. LabVIEW gets array pointer, passes it to the dll itself, inside the node. Depending on DLL type you may need to preallocate array (initialize array with enough elements) to fit output data.

Message 2 of 7
(4,156 Views)

Could you give me a simple example of it please? I'm a little confused.

0 Kudos
Message 3 of 7
(4,144 Views)

Help -> Find Examples -> Call DLL.vi has examples for all data types.

Message 4 of 7
(4,138 Views)

I'm using Labview 2015 and I could not find the call dll.vi in the "example search". Can I download it somewhere?

0 Kudos
Message 5 of 7
(4,131 Views)
Solution
Accepted by topic author Xinghe.W

Looks like it's now named "External Code (DLL) Execution.vi".

 

If you browse to it, it's under the main heading of "Communicating with External Applications" and the sub-heading "Using External Code".

 

Run it, scroll to the bottom of the list, double-click "1D Array".

Message 6 of 7
(4,118 Views)
Solution
Accepted by topic author Xinghe.W

hmm... i would be very surprised to know they really removed such an example.

Call Native Code.llb - > call dll.vi.

Message 7 of 7
(4,112 Views)