LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

understanding the webcam.dll file

Solved!
Go to solution

Hi there everyone, I am trying to learn how to use call library in Labview and this would be my first time doing so.

I am looking at an example online for usb and webcam.

I found this example with 

WEBCAMGRAB.DLL

 

I looked into the blocked diagram and i see 3 inputs.

the reason i know this because the block diagram said so.

lets say that i don't have the blocked diagram and only the WEBCAMGRAB.DLL file. How would I know how to use the file in CALL LIBRARY node?

how do i know that int32 is driver, width, and height?

 

Message Edited by krispiekream on 03-12-2009 04:36 PM
Message Edited by krispiekream on 03-12-2009 04:38 PM
Message Edited by krispiekream on 03-12-2009 04:39 PM
Best regards,
Krispiekream
Download All
0 Kudos
Message 1 of 20
(6,840 Views)
Who did you get the example VI from?  They must have a .FOR file that goes with this VI.  The .FOR file will list the subroutines and what parameters they expect to receive and/or pass out.
0 Kudos
Message 2 of 20
(6,827 Views)

You need the documentation for the DLL. Or, the .h file that lists the protoypes.

 

You may want to peruse this document: Using Existing C Code or a DLL in LabVIEW. There is also an example that ships with LabVIEW showing you a variety of input types. Help -> Find Examples, and search for "DLL". The example is "Call DLL". 

 


jmcbee said:
They must have a .FOR file that goes with this VI.  

.FOR?

 

0 Kudos
Message 3 of 20
(6,824 Views)

Is it Friday Yet?  I momentarily lost my mind.


smercurio_fc wrote:

You need the documentation for the DLL. Or, the .h file that lists the protoypes.

 

You may want to peruse this document: Using Existing C Code or a DLL in LabVIEW. There is also an example that ships with LabVIEW showing you a variety of input types. Help -> Find Examples, and search for "DLL". The example is "Call DLL". 

 


jmcbee said:
They must have a .FOR file that goes with this VI.  

.FOR?

 

 


 

Message Edited by jmcbee on 03-12-2009 04:11 PM
0 Kudos
Message 4 of 20
(6,822 Views)
thank you
smercurio_fc and jmcbee for your help on this issue for me.
its always a challenge learning new things..
i did get a chance to read over the document you gave me and the example is really easy. 
what if i don't have the .h file?
do you have examples of using .DLL to hardware?
 
 
 
i got the example somewhere on this forum...its been 5 years since i took the last C programing class...
 
here is the DLL.H
 
#ifndef _DLL_H_
#define _DLL_H_
#define EXPORT __declspec (dllexport)

EXPORT long SetUp(long driver, long width, long height);
EXPORT long GetDigitizer(long DigitizerID, CHAR *str);
EXPORT void Grab(unsigned char *LVPict);
EXPORT void ShowDialog(long WhichDlg);

#endif
 

Message Edited by krispiekream on 03-13-2009 12:27 PM
Best regards,
Krispiekream
Download All
0 Kudos
Message 5 of 20
(6,789 Views)
Solution
Accepted by topic author krispiekream

The .h file is useful as it allows you to run the Import Shared Library Wizard. This will (try to) create individual VIs for each function in the DLL. The wizard requires the DLL itself, and the header file. If you don't have the .h file then you need to wire up the Call Library Function Node function.

 

Using a DLL to control hardware is no different than using a DLL for something else. It's all a matter of understanding what functions to call, and in what order. Common problems are in allocating memory for arrays or strings. Usually DLL functions assume the caller has allocated the memory for these.

 

What is the VI that you uploaded supposed to demonstrate?  It calls a bunch of subVIs, none of which are included. Are you calling the DLL in these subVIs?

Message Edited by smercurio_fc on 03-13-2009 01:01 PM
Message 6 of 20
(6,782 Views)

oh..the test.vi that i included is to show you where i got the files from.

 i have attached another file.

it really doesn't help you to help me much, but it just tell you where i got the webcam.dll from.

hmmm...i'll look more into import shared library wizard and see if that will work out for me..

thanks

 

Best regards,
Krispiekream
0 Kudos
Message 7 of 20
(6,778 Views)

ok..after running the wizard..i am now facing this issue...

 

 

 

Message Edited by krispiekream on 03-13-2009 01:43 PM
Best regards,
Krispiekream
0 Kudos
Message 8 of 20
(6,769 Views)

That usually means you have the wrong version of the DLL. For example, you have a Windows 9x version of a DLL and are trying to use it on XP. Where did you get the DLL? It's obviously not the one in the webcam library, since the DLL in there is named "WebcamGrab.dll", and there's also wrapper VIs written for it, so there's no need to run the wizard on it (unless you're doing it to learn).

 

If you upload the DLL (would need to zip it) it can be looked at. 

Message 9 of 20
(6,762 Views)
Hi

Smercurio_fc!!

Thank you for helping me on this. Sorry about the late response. I was stuying for a final the whole weekend and now I am back working on this project...

Here is my DLL file. can you please take a look and see what's the problem here?

thanks

 

Best regards,
Krispiekream
0 Kudos
Message 10 of 20
(6,712 Views)