LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Labview crashes after second call to DLL

Hi.
I am trying to use DLL to format barcode label, distributed by WASP. I working under Windows 98.Labview Version is 6.0.2

After second call to this DLL Labview crashes without any error message. Black DOS QNC window shows up and then, Labview completely exits.
I suspect that something goes wrong in memory, but have no idea how to fix it.
I wonder if somebody can give me any clue.
Thank you in advance,

Peter
0 Kudos
Message 1 of 4
(3,141 Views)
Peter,

We had a similar situation when a customer's C++ Exec was callling out dll, which turned out to be a threading problem. Actually, the problem was a little more complicated.

I would check for open references, open hardware, etc. You may be neglecting to close a DAQ or Serial session, or something to that effect. However; the problem could be within the dll.

The symptom you are seeing I have seen in IMAQ VIs. For whatever reason, LabVIEW causes a complete application or system failure when a memory allocation error occurs. I believe this is sympomatic of a larger problem in LabVIEW, but suspect that they are working on it.

Try getting in touch with NI and see what they say. Also, put your code in Highlight Execution mode to track down ex
actly where the problem occurs. I found this to be very helpful in isolating the IMAQ dlls as a source of an application crash in LabVIEW which turned out to be something as simple as a missing ROI input.

Good luck
0 Kudos
Message 2 of 4
(3,141 Views)
> We had a similar situation when a customer's C++ Exec was callling out
> dll, which turned out to be a threading problem. Actually, the
> problem was a little more complicated.
>
> I would check for open references, open hardware, etc. You may be
> neglecting to close a DAQ or Serial session, or something to that
> effect. However; the problem could be within the dll.
>
> The symptom you are seeing I have seen in IMAQ VIs. For whatever
> reason, LabVIEW causes a complete application or system failure when a
> memory allocation error occurs. I believe this is sympomatic of a
> larger problem in LabVIEW, but suspect that they are working on it.
>
> Try getting in touch with NI and see what they say. Also, put your
> code in Highlight Execution
mode to track down exactly where the
> problem occurs. I found this to be very helpful in isolating the IMAQ
> dlls as a source of an application crash in LabVIEW which turned out
> to be something as simple as a missing ROI input.
>


If the OS crashes, then more was involved than just LV. LV is an
application and has no protected code in it. It is not supposed to be
possible for LV to crash the OS without the aid of a driver. Drivers
have code that runs protected, as part of the OS, and if they get
confused, by LV or user inputs, they can lead to blue screens, etc.

For this case, I suspect that the DLL is overwriting memory and
corrupting the structures used by the memory manager. The second call
tries to access the same structures and crashes when doing so because
the pointers are no longer valid. I'd check to see if the DLL is
returning data in strings or arrays. If so, it probably expects you to
have adequately sized buffers before calling it. You can preallocat
e a
string or array, or use a constant full of blanks, it really doesn't
matter, but that is probably the most common cause of DLLs not working
as expected.

Greg McKaskle
0 Kudos
Message 3 of 4
(3,141 Views)
I had similar problem by calling some dll-functions.
My problem was, that I had to reserve memory for the output data. For
example if I expect as an output a 1D-array with 15 elements so I have to
connect an array constant oh the same size with the input terminal of the
output terminal.

hope that helps, Niko
Message 4 of 4
(3,141 Views)