08-31-2009 04:34 AM - edited 08-31-2009 04:42 AM
Iam facing problem in accessing dll in labview (8.2)
The dll is written in visual c++.]
The following error message comes when am calling the dll
above shown is the error message .
Iam attatching the source code iun vc++,
please suggest whether the header files are correct?
Pls reply..
The source code is also attatched.
Solved! Go to Solution.
08-31-2009 09:35 AM
09-01-2009 12:13 AM
I have attatched the DLL and VI configured for the same dll.
I am using VC 2005 version.
I am using the debug version.
The problem comes when I am accessing the dll from a machine , other than the one on which it was created.
I am having the same bit- length(32 bit dll).
Moreover , am havin another problem with the dll.
The dll actually inserts a 0 at every fourth index of an array. But, when am accessing the same dll in labview 8.2 the logic
works for an array havin a size less than 200.
My application requires to process an array 0f size 13 lac.
Please find the attatched code and give me advice regarding the memory considerations .
pls reply
09-01-2009 09:11 AM
The VI you posted is looking for a DLL called rep.dll, but you posted a DLL called flycap.dll, so I have no idea what DLL you're trying to use. The VI you posted has the Call Library Function Node configured for a function that has an array of U8 and an I32 as its two arguments, but the "fly" function in the flycap DLL has a prototype of an array of I32 and an I32 as its 2 arguments. So, again I have no idea which DLL you're trying to configure.
Since you are using VC you need to have the Visual C++ Redistributable Package installed on any machine that does not have VC installed.
As an aside: Is that all that the DLL is doing? If so, what's the point? You can do the same thing in LabVIEW quite easily and far more efficiently since you don't have to incur stepping into a COM layer.
09-02-2009 01:50 AM
smercurio_fc wrote:
Since you are using VC you need to have the Visual C++ Redistributable Package installed on any machine that does not have VC installed.
As an aside: Is that all that the DLL is doing? If so, what's the point? You can do the same thing in LabVIEW quite easily and far more efficiently since you don't have to incur stepping into a COM layer.
To the OP:
Your DLL is most likely linked to use the Multithreaded (Debug) DLL runtime. This means you do need to install the VC redistributable C runtime library that comes with your VC installation on every computer you want to run that DLL. Newer computers (Vista as well as computers having installed IE7) will have the VC 2005 runtime installed by default (since they contain componenets that were created with that version to) but most XP computers will not. Or you change the link settings in the VC project to include the multithreaded static runtime lib, which will link in all the neccessary VC runtime code, to make the DLL self contained.
To smercurio:
Not sure where you see COM getting into the play for this DLL!
But I agree. Using a DLL for such operations is a lot of work for nothing and most likely it is not a single bit faster than LabVIEW too.
Rolf Kalbermatter
09-02-2009 08:50 AM
rolfk wrote:
To smercurio:
Not sure where you see COM getting into the play for this DLL!
Beats me. For some reason my brain switched to ActiveX. Must be my mutant brain.
09-02-2009 11:39 PM
Sorry , I posted an earlier version of the dll.
I have attatched the original ones .
My application is actually to conver a 24-bit image to 32-bit image, for which am padding zeroes .
I have done the same in labview8.2, but it is taking a processing time of 60ms(approx).
My target is to do it under 30ms. So, was trying luck with dlls .
So please suggest me , whether dll will improve the timing or not than when it is done directly in labview.
The concern is that a 1-d array of 13 lacs is to be processed.
Moreover i did not understand the phrase "You can do the same thing in LabVIEW quite easily and far more efficiently since you don't have to incur stepping into a COM layer. "
Pls Explain..
regards
Rahul
09-03-2009 12:44 AM
What is an lacs? When you say that the LabVIEW code took to long it could be that you simply did a rather suboptimal LabVIEW routine. Can you show us what you did?
Rolf Kalbermatter
09-03-2009 07:19 AM
1 lac= 100000
In labview i used a simple for lop to pad zero at every fourth index starting from zero.
here is a snapshot
The zero padding is taking 60ms each time because it has to process some 1300000 elements at one go.
The array is generated from a camera .
Pls sugest me with an optimal code to reduce delay
Rahul
09-03-2009 09:11 AM - edited 09-03-2009 09:13 AM
I love Build Array inside a loop!!! Really what you do here is about similar to this in C:
for (i = 0; i < len; i++)
{
optr = realloc(optr, (i + 1) * 4);
optr[i * 4] = 0;
optr[i * 4 + 1] = iptr[i * 3];
optr[i * 4 + 2] = iptr[i * 3 + 1];
optr[i * 4 + 3] = iptr[i * 3 + 2];
}
I think you can see what the problem is with this.
Instead you want to do something like this:
It's about factor 100 faster on my machine than your original idea.
Rolf Kalbermatter