LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

access violation TDT dll using Call Lib Funct.....

Hey,
I've looked thru the newsgroups and Knowledgebase but to no avail with
this particular problem: I'm running LV4.1 and trying to make a .dll
function call using a Call Library Function . Now, I'm trying to talk to
the Tucker Davis System II dsp system. I have the 32-bit dll and
controller from TDavis plus all the documentation on the format of the
functions inside the dll...The controller (which is just a software
program to test the tdt system) works fine and I think that it must also
be using the tdt dll..

Ok, so when I create the call lib function and I tie it to my dll and
the function I want to call, the arrow goes from broken to solid --- so
I know that my function has been found...

But anytim
e I try and run the vi I get an instant "Access Violation in
Cx0000005 (s2drv32c.dll) in Labview.exe" --- now, I've read that you
must make the function call exactly like the dll wants or else you'll
get an error but I've tried every possible combination and still the
same error.......

Has anyone comes across a situation like this before?? Is it LabVIEW or
my .dll that is the problem (NOTE: the dll came directly from TDT so I
don't think it's a "mangled code" problem)??

Thanks in advance,

Nullspace();
0 Kudos
Message 1 of 2
(1,608 Views)
> I've looked thru the newsgroups and Knowledgebase but to no avail with
> this particular problem: I'm running LV4.1 and trying to make a .dll
> function call using a Call Library Function . Now, I'm trying to talk to
> the Tucker Davis System II dsp system. I have the 32-bit dll and
> controller from TDavis plus all the documentation on the format of the
> functions inside the dll...The controller (which is just a software
> program to test the tdt system) works fine and I think that it must also
> be using the tdt dll..
>
> Ok, so when I create the call lib function and I tie it to my dll and
> the function I want to call, the arrow goes from broken to solid --- so
> I know that my function has been found...
>
> But anytime I try and run the vi I get an instant "Access Violation in
> Cx0000005 (s2drv32c.dll) in Labview.exe" --- now, I've read that you
> must make the function call exactly like the dll wants or else you'll
> get an error but I've tried every possible combination and still the
> same error.......
>
> Has anyone comes across a situation like this before?? Is it LabVIEW or
> my .dll that is the problem (NOTE: the dll came directly from TDT so I
> don't think it's a "mangled code" problem)??
>

I suspect that it isn't LV or the DLL, but the configuration of the node.
DLLs export a low level C interface, and if much of anything goes wrong,
the program they are part of will crash.

Several common problems are that the calling conventions may be wrong.
Look into the documentation for the DLL or contact the vendor and find
the correct calling conventions. Also make sure that you have the
parameters in the right order and the right data types. These are easy
to get right, but pretty easy to get wrong as well.

Once these are correct, you need to determine if the DLL is trying to
write data into an output and send it back to LV. If so, you need to
size the string or array before calling the DLL. Use the Init Array or
similar functions to make an array or string big enough for the DLL to
write into. Other problems can occur with the DLL if it assumes how
the data is being passed and tries ot realloc the array or string.

Another thing you might try is to ask Tucker if they have VIs built on
top of the DLL to save you the effort.

Greg McKaskle
0 Kudos
Message 2 of 2
(1,608 Views)