01-21-2006 02:32 PM
01-22-2006 06:31 AM
The caller has to provide the memory a function in a DLL is supposed to write into. By not wiring anything to your third parameter you basically do not provide any memory to write to but still tell the function in the last parameter that you passed in a buffer of 180 byte. The function then tries to copy the information it has into this not existing buffer and crashes.
@the phan wrote:I am very new to dll. I try to learn and convert my VIs to LabView dll. Finally, I am successful to generate a Vi that has a call dll library.But it keeps crashing on Labview either by itself or when I close LabView.Attached is a zip file, MLC_sample is main VI, MLC_using dll is the one I would like to use. error.bmp is error message.When I built the dll. At the output string parameter, it always has a "len" parameter adds on.It is the length of string that requires for memory of output string. I have to use some number to get the right data to display.Please tell me what I did wrong when I built my dll.How to make a multi funtions dll library by using LabView VIs.I would like to thank to all of you about "dll" subject and all the sample VIs on the NI forum. I learned alot from it for the last year. Every time I had no solution then it was there.Happy Lunar New Year
01-22-2006 02:09 PM
Hi Rolfk,
I modifed the VI per your advice and it is not crashed any more.
Number of Leaves and MLC data changed so I add to VI some funstions, so "len" can be controlled programable
Thank you for your explaination and suggestion.
Attched is what I modified. Does any output require "len" element?
My next headach is converting some of 200 VIs to DLL.
I used 1D and 2D string arrays to my VIs. Is there any example to use string array as input?
Using 7.1 and XP
01-22-2006 03:14 PM
Arays of strings will be quite a bitch to deal with both to call that DLL from LabVIEW as well as for the poor guy who is supposed to call your DLL from C or even worse Visual Basic.
@the phan wrote:Hi Rolfk,
I modifed the VI per your advice and it is not crashed any more.
Number of Leaves and MLC data changed so I add to VI some funstions, so "len" can be controlled programable
Thank you for your explaination and suggestion.
Attched is what I modified. Does any output require "len" element?
My next headach is converting some of 200 VIs to DLL.
I used 1D and 2D string arrays to my VIs. Is there any example to use string array as input?
Using 7.1 and XP
01-22-2006 03:42 PM
Hi Rolf,
I am in second case.
My project is about 200 VIs, some are main and some are sub-VI.
I always built them in one big application.EXE. If I want to modify or fix errors, then I have to rebuild a big.EXE again.
Correct me if I am wrong, I think if I convert some of VIs to DLL and in the future if I want to change them, I just re build that DLLs and keep the application.EXE untouch. It is easier to upgrade.
01-22-2006 04:37 PM
The best and easiest solution in that case is to do everything inside LV. You can do this by calling VIs dynamically using the VIs in the Application Control palette like the Call By Reference VI and the Run VI method. These will allow you to call compiled VIs directly in the RTE and you will be able to replace the VIs whenever you want as long as you make sure that they are properly compiled (saved with all changes and having all the subVIs they need).
You can probably find examples and tutorials for this in the example finder and on this site by searching for "dynamic" or "VI server". You should also find some data in the LabVIEW user manual.
01-22-2006 04:56 PM
01-23-2006 12:27 AM
I have projects with 800 VIs and recompile them each time I change something, so what?
@the phan wrote:Hi Rolf,
I am in second case.
My project is about 200 VIs, some are main and some are sub-VI.
I always built them in one big application.EXE. If I want to modify or fix errors, then I have to rebuild a big.EXE again.
Correct me if I am wrong, I think if I convert some of VIs to DLL and in the future if I want to change them, I just re build that DLLs and keep the application.EXE untouch. It is easier to upgrade.