02-11-2009 05:36 AM
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?
02-11-2009 05:59 AM - edited 02-11-2009 05:59 AM
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
02-11-2009 06:31 AM
Hi Mike,
Please see attachment.
02-11-2009 06:40 AM - edited 02-11-2009 06:41 AM
Hi CIM LabVi...,
you have to connect input values. Right click on the input and select -> create -> constant.
Mike
02-11-2009 09:27 AM
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.
02-11-2009 01:13 PM - edited 02-11-2009 01:14 PM
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