06-21-2005 05:39 PM
06-22-2005 02:29 AM - edited 06-22-2005 02:29 AM
@Sandeepvd wrote:
Please look at ‘DummyWrapper.VI’
There is something wrong with implementing ‘Call Library Function1’
It leads to 2 errors.
I have included VIs which I used to create the DLLs.
Can someone write example code showing correct way to point to an array inside the DLL?
thanks
Sandeep
Message Edited by rolfk on 06-22-2005 02:32 AM
06-22-2005 11:41 AM
06-23-2005 03:41 AM - edited 06-23-2005 03:41 AM
@Sandeepvd wrote:
Hello Rolf.
I am pretty sound with pointer concepts however situation is as follows. See what can be done.
I have a set of VIs in LV6.1 from a vendor XYZ to support their device.
VIs do NOT have block diagrams.
The first VI creates an array (unknown size usually up to 10) and gives it to me.
The vendor support is DEAD.
I MUST port VI to 7.0 or to higher version.
To do this, my approach is:
I am creating DLLs of their 6.1 VIs.
Will Call the DLLs from 7.1
I have simulated DLL functionality (which is exactly same as vendor VIs functionality) in DLL VIs I created and have attached.
When I tried to call them thru ‘DummyWrapper.VI’ I hit the problems you saw.
Modifying vendor VIs is out of question.
My question is how can I use them as they are (I realize there will be some memory leakage, but first VI (...Connect.VI) is going to be called only once in several months. I can afford it) ? Can you suggest?
Is there any other way?
Best Regards
Sandeep
Message Edited by rolfk on 06-23-2005 03:44 AM
06-23-2005 07:10 PM
06-23-2005 07:12 PM
06-23-2005 10:32 PM
06-24-2005 12:48 AM - edited 06-24-2005 12:48 AM
@Sandeepvd wrote:
My concerns are as follows:
assumptions:
Array size being passed as an input to any DLL, is bigger than the corresponding data size generated inside the DLL (underlying LV6.1 wrapper code)
There is no inherent memory leakage inside vendor code that is available (which I have no access to but) which has been tested with LV6.1 for 2 years.
#Concern 1
Variable is being passed as an array data pointer. Since it is being passed by reference theoretically as in C, it should not cause any memory leak. However I am unaware about- how LabVIEW understands that the array pointer being passed as an input is for the data it is going to generate? In short I am not clear (but have to be if I want to se this path) how passing by reference works in the (labview) DLL wrapping a labview code.
Message Edited by rolfk on 06-24-2005 12:51 AM
06-24-2005 12:54 PM
06-24-2005 12:58 PM