LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

problem accessing a dll

Solved!
Go to solution

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

 

 

img.PNG

 

 

 

 

 

 

 

 

 

 

 

 

 

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.

  

Message Edited by siju on 08-31-2009 04:39 AM
Message Edited by siju on 08-31-2009 04:42 AM
0 Kudos
Message 1 of 10
(4,107 Views)
How did you configure the Call Library Function Node? Which version of Visal C++ are you using? Are you using the debug or release version of the DLL? Are you loading the DLL on the same machine where it was created? If you're not loading the DLL on the same machine it was created then do you have the same bit-length (i.e., 32-bit, or 64-bit DLL)? If you're not on the same machine and loading the debug version and you're using a .NET-based Visual C++ then do you have the Visual C++ Redistributable Package installed?
Message 2 of 10
(4,070 Views)

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 

Download All
0 Kudos
Message 3 of 10
(4,052 Views)

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. 

Message 4 of 10
(4,036 Views)

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! Smiley Very Happy

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

Rolf Kalbermatter
My Blog
Message 5 of 10
(4,023 Views)

rolfk wrote:

 

To smercurio:

 

Not sure where you see COM getting into the play for this DLL! Smiley Very Happy


Beats me. For some reason my brain switched to ActiveX. Must be my mutant brain.

Message 6 of 10
(3,997 Views)

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 

0 Kudos
Message 7 of 10
(3,983 Views)

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

Rolf Kalbermatter
My Blog
0 Kudos
Message 8 of 10
(3,975 Views)

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

 

pic.PNG 

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 

0 Kudos
Message 9 of 10
(3,963 Views)
Solution
Accepted by topic author siju

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:

 

interleave array.PNG

 

 

It's about factor 100 faster on my machine than your original idea.

 

Rolf Kalbermatter

Message Edited by rolfk on 09-03-2009 04:13 PM
Rolf Kalbermatter
My Blog
Message 10 of 10
(3,952 Views)