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.
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.
05-01-2014 02:08 PM
I was trying to create a 64bit DLL using LABVIEW 64bit. The code accepts an array as input (U8 type) and returns two array output (one double and one I32).
I was able to create the DLLs but they never worked. Can you please help me out with an example?
Thanks
05-01-2014 02:46 PM
I believe you need to preallocate the array input and outputs. See here for more info: http://forums.ni.com/t5/LabVIEW/Problem-in-calling-LabVIEW-DLL-with-C/td-p/2627315
Also, are you calling from C#, i presume? Anything more specific - such as what you want to acomplish would be helpful.
05-01-2014 03:02 PM
Dont laugh on my stupid experiment. I am creating a DLL and calling it back in LABVIEW.[:)]
I have preallocated memory.
05-01-2014 03:27 PM - edited 05-01-2014 03:29 PM
Oh wait. You are making a DLL and calling it inside LabVIEW?
My bad for misunderstanding haha.
Use this: Call Library Function Node
You can find detailed guides here:
http://www.ni.com/white-paper/3009/en/
http://zone.ni.com/reference/en-XX/help/371361J-01/lvexcodeconcepts/configuring_the_clf_node/
If you have a more specific question regarding them, let me know!
05-01-2014 03:39 PM - edited 05-01-2014 03:42 PM
Please see screenshots of the source code and calling function, I can read just one sample out of the ARRAY but not the complete array. Even though I specify the length of input arrray. Any idea what's wrong ....
05-01-2014 04:17 PM
What do you mean by "just one sample out of the ARRAY"? Which array? Can you provide the actual code instead of a screenshot, saved with default data?
How did you configure the DLL build? It's important whether you configured it to accept LabVIEW-specific data, or a more generic C array. In the case of a C array, multi-dimensional arrays are tricky and may not work properly; it would be better to pass a 1-D array.
05-02-2014 10:40 AM
I finally fixed the issue. The return value has to be array by handle instead of array by pointer. Initialization didn't make any change but caused a bit overload.
Thanks
05-02-2014 01:56 PM
Glad to hear you got it working. The configuration needs to match between the way you build the DLL (when you define the VI's prototype) and the way you call it. Note that if you're passing parameters as handles, it will be very difficult to call that DLL properly from any language other than LabVIEW (and if you don't need to call it outside of LabVIEW, then why are you building a DLL?).