I am working on to write a wrapper to a dll. The call to dll works fine an returns appropriate values but as soon as i close the VI the LabVIEW dev environment crashes. Any help on avoiding the same. I went through a lot of posts and tried varing the types of data being sent to the dll but still it gets crashed.
the dll function I am using is of the prototype(with C type call convention)
int functionName(Struct *cfg, UCHAR dNumber, UCHAR hTYPE)
The UCHAR varables I am passing as Unsigned 8-bit Integers.
For the structure I have made a cluster and am passing with Adapt to Type and as Handles.
The DLL executes fine and the VI stops too, but as soon as i try to close the VI the dev environment crashes. Please help.
Solved! Go to Solution.
It's always possible that there's a bug in your DLL, or that you're failing to call some function in the DLL that's required in order to clean up properly. The problem may not be the way you've set up the Call Library Function Node.
If you post: your VI; the header file that defines the cfg struct and the function prototype; and any documentation on the function, then we can tell you if it's configured properly. Without that information there's not much we can do.
While nathand is right about possible other errors, the Struct that you fail to tell anything about is a big flag pole for something that might be going wrong. Show us the C header declaring the structure and function and attach the VI you created (please no BMP or other image! They do say a picture says more than thousend words, but in the case of a LabVIEW diagram a picture is not enough to show all aspects of a VI, especially things like how the Call Library Node is configured!)
Thanks Nathand and Roflk, as suggested by nathand the problem was because i was not calling the exit function in the dll which seems also performs the fucntion of cleaning up the memory pointers. 🙂
For the info the structure was made up of to 7 UCHARs and two INTEGERs. Sorry i cant post the code as it is closed sorced to the client am working for and am unsure of the legalities, still tried my best in explaining the problem i was stuck with.