LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Upgrading from LV 8.2 to LV 8.6 causes broken errors in DLL calls

I have a working LV 8.2 driver with DLL calls.

When I upgrade to LV 8.6 I get broken errors.

I use the same DLL for both LV versions.

 

The error description is:

"One or more required inputs to this function are not wired or are wired incorrectly. Show the Context Help window to see what the connections to this function should be."

 

Can you help me?

0 Kudos
Message 1 of 6
(3,189 Views)

Hi CIM LabVi… ,

can you show an image of such a call. I know it in the other direction from 8.5/6 back to 8.0, because there are no error terminals at the "call library function node".

 

Mike

Message Edited by MikeS81 on 02-11-2009 12:59 PM
0 Kudos
Message 2 of 6
(3,185 Views)

Hi Mike,

 

Please see attachment.

0 Kudos
Message 3 of 6
(3,173 Views)

Hi CIM LabVi...,

you have to connect input values. Right click on the input and select -> create -> constant.

 

Mike

Message Edited by MikeS81 on 02-11-2009 01:41 PM
0 Kudos
Message 4 of 6
(3,171 Views)

I think you have a bigger problem. While it's true that you have to provide an input, I highly suspect that the DLL call assumes that the caller is allocating the memory in which to place the strings. If it assuming this, and you don't do this then your program will crash LabVIEW. You need to look at the documentation for that DLL call to determine

a) is it expecting the caller to pre-allocate the memory for the strings

b) if (a) is true, then how much memory.

 To allocate this memory you would need to use Initialize Array to create an array of U8s and then use the Byte Array to String to get a string that you can then wire to your DLL call input. Open the example called "Call DLL" that ships with LabVIEW.

0 Kudos
Message 5 of 6
(3,146 Views)

smercurio_fc wrote:

I think you have a bigger problem. While it's true that you have to provide an input, I highly suspect that the DLL call assumes that the caller is allocating the memory in which to place the strings. If it assuming this, and you don't do this then your program will crash LabVIEW. You need to look at the documentation for that DLL call to determine

a) is it expecting the caller to pre-allocate the memory for the strings

b) if (a) is true, then how much memory.

 To allocate this memory you would need to use Initialize Array to create an array of U8s and then use the Byte Array to String to get a string that you can then wire to your DLL call input. Open the example called "Call DLL" that ships with LabVIEW.


And if a) is false you have a really big problem. LabVIEW will not be able to deal with that since it can not reuse dynamically allocated pointers from a DLL.

 

And in LabVIEW 8.5 and higher you also can set the actual size each parameter should be allocated for in the LabVIEW Call Library Node configuration, forgetting about the Initialize Array Node.  But one of these two methods to allocate a buffer will be absolutely required.

 

Just watch out the CLN configuration to allocate a certain amount for array and string parameters will not be backportable to earlier LabVIEW versions so saving to pre 8.5 will break such a VI.

 

Rolf Kalbermatter

Message Edited by rolfk on 02-11-2009 08:14 PM
Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
0 Kudos
Message 6 of 6
(3,123 Views)