03-11-2009 08:36 AM
Mathan,
Here it is in LabVIEW 7.1. There is some extra code because of how our tester worked (and ignore the globals VI it tries to load), but the core of working with the PM3 should be fine.
You may want to run the executable it is pointing to in a command window (so you can see all the possible commands) to be sure you have all the parameters set. Off the top of my head, I cannot recall which microcontroller was being programmed.
03-11-2009 09:12 AM
Thanks a lot for your time John. Surely this is going to help me. Ill ask you if any questions arises after executing this tomo. Have a nice day.
Thanks a lot
Mathan
06-02-2010 01:03 AM
Hey Guys,
I am facing problem like LabVIEW shutting down while creating VIs for Microchip .dll files while using LabVIEW 2009.
Where as this is not happening while using LabVIEW 8.6 or lesser.
Can I know what can be done to avoid shutting down of labVIEW application?
Thanks,
Sail
06-02-2010 01:15 AM - edited 06-02-2010 01:22 AM
I think you want to say that you try to interface to the Microchip DLL using the Call Library Node. If that causes LabVIEW to crash you know that you do something wrong. The immediate suspect would be the calling convention here, but since you say it "worked" in LabVIEW 8.6 this seems not the problem.
So then there are the other suspects:
1) Making sure that you do configure the Call Library Node parameter types to really match the actual DLL function parameters.
2) Most Call Library Node users favorite problem: Make sure that you allocate any buffere large enough for that function.
To point 2) above: Unlike LabVIEW VI's where you can pass in an empty array to let the VI resize it to the size required to fill in information and return it to the caller, this does usually not work when calling C functions. The C function can normally not and will not resize that buffer but simply expect the caller to have provided a buffer large enough to write in whatever it feels to write in. This is a variant of the cause of the infamous buffer overrun exploits that get fixed in regular patch updates on all major OSes nowadays.
So when you pass array and string pointers to DLLs make sure they are sized large enough for the function in question. For input only buffers this is obviously not a problem but any array or string pointer that receives information from the function has to be checked for that. To allocate a large enough buffer in LabVIEW you can either use the Initialize Array primitive or if you use LabVIEW 8.5 or later configure the Minimum Size value in the parameter configuration for such parameters
To short buffers can often not show any bad symptoms right away. It may seem to work either because the DLL function only returns small amounts of information that fit in the allocated buffer or it is overwriting illegal memory anyhow but that has not to be fatal immediately but only after you try to quit the application (LabVIEW goes and wants to properly deallocate everything and stumbles over destroyed pointers) or sometimes not at all (but it is still doing something illegal and with the potential to create a real mess after some time).
Seemingly small changes to the VI, or LabVIEW version changes, or compilation into an executable suddenly can cause the app to crash anyways since now the memory layout of your app has changed and the to small buffer suddenly lays right ahead of an important pointer in the memory so when the function overwrites that pointer illegally it causes a crash almost right away.
06-02-2010 01:29 AM
Hey Rolf,
Thanks for ur reply...
I am not using call library function in my VI.
I am using IMPORT function in the Tools section of LabVIEW.
It automatically creates user libraries for DLLs required, during this process I am seeing the shut down of LabVIEW.
Both LabVIEW 8.6 and LabVIEW 2009 is runnign on XP with SP3.
Thanks,
Sail
06-02-2010 06:19 AM
Well the Import Library Wizard does create VIs that use the Call Library Node. So you would be using that if the import library wizard would finish. Most likely your header file contains some definitions over which the import library wizard stumbles somehow. As such that is a bug/problem in the import library wizard and you have to work with NI support to let them know about it. They will need the header file that causes the problem.
As a workaround: Since it seems to work with earlier versions of LabVIEW you can simply import the header file in that version and let it create your VI library and then use that VI library in your 2009 version of LabVIEW.
06-03-2010 03:35 AM
Hi Sail,
Could you post the files you're working with, so we can make sure it's not your LabVIEW installation? Also, it will help us diagnose the issue if it is a bug in LabVIEW 2009. Thanks.
Regards,
Imtiaz Chowdhury
Project Manager
Green Running / Austin Consultants
07-15-2010 10:29 AM
Hey Imtiaz,
Sorry to reply this late... As I had got stuck with something else.
Here are 2 files where the import wizard doesn't seem to create user libraries.
I myself tried it again to create VIs on LV2009 and LV8.6 on 2 different systems. I see that I can easily get through 8.6 where as 2009 PC just shuts down LV with exception error.
Please have a try on it and let me know if you were able to get through 2009.
Cheers,
Sail
07-20-2010 04:57 AM
Hi Imtiaz,
Did you get through the import library function for the files on LV2009?
If so please please help me on it.
Thanks,
Sailesh
08-27-2013 12:14 AM
can u please tell me how you have dump the labview code in AVR controller
what are all the supporting softwares u have used?
and finally whats the procedure?
thank u