LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Using a Third Party SDK in LabVIEW

Hi,

I am not an expert of LaBVIEW. I wanted to interface Canon Camera with LabVIEW. I tried to use this toolkit I tried using Third Party Software to interface it but the program intiiates with many errors. 

I am attaching the list of errors so that you can also check it.

Finally i have decided to interface the canon camera using its own SDK, i have written to the Canon.

To use the canon SDK i need some guidance on how an SDK could be used in LABVIEW and how can I control the functions of Camera using the Canon SDK.

I therefore would like to request you to please guide me through the procedure.

I shall be highly thankful to you.

Regards

0 Kudos
Message 1 of 6
(5,556 Views)

Hi,

In the installation directory of the Third Party Software mentioned above i have found the dll of canon. Can you please tell me how can i use the dll in LabVIEW.

I have read How Do I Call a Dynamic Link Library (DLL) from LabVIEW? but it didn't helped as my installation folder doesn't contains any *.h files.

Also I am new with dll files and how to use it in LabVIEW.

Please guide me how to do that.

Thanks

0 Kudos
Message 2 of 6
(5,530 Views)

Ah, I didn't see there was also a forum post. Reposting my private message so others can know what I already suggested and add improvements/better suggestions. Slightly edited to reflect different setting:

 

 

---------------------

Glad to hear you were able to get hold of the SDK.

 

As to guidance, I don't have the SDK, or the documentation, but I would imagine that it contains perhaps a C library in dll form, or similar? Hopefully it also contains some vaguely useful documentation, but this varies quite a lot from product to product and I have no experience with Canon.

 

If it is a C library, you'll be wanting to use the 'Call Library Function' LabVIEW function. It is available under the 'Connectivity > Libraries and Executables' palette. Right clicking on the node after you place it on a block diagram will allow you to click 'Configure...' where you can select a path for the dll file you have, type the function name you want (from the Canon documentation, hopefully) and then on the second tab ('Parameters') you can change the return value type and the number and type of parameters to pass to the function (including pointers, which are very commonly used in some similar libraries I use at the moment - they might or might not be popular in the Canon SDK).

 

The LabVIEW dialog you get when you click 'Configure...' gives you a preview of what the function call looks like - although the type names might be slightly different, you're looking to get it to be similar to what you have in the documentation. Then, when you click 'OK', the block will resize to allow you to wire inputs and outputs like a normal subVI. By placing these library calls in subVIs, or by linking several together, you can use whatever you need from the dll to get your program working!

 

To start with, I'd suggest trying to just get a connection to the camera and call a basic function that returns some sort of information, such as the firmware version. You can check the returned value in LabVIEW with what you see on the actual camera, in order to make sure you have a working connection and a grasp on the 'Call Library Function' node.

 

Good luck!

-------------------------------

 

I note from your messages in this thread that you perhaps didn't get the SDK from Canon, but rather took the dll from the downloaded library. Although this might well give you all of the same functions, you're going to struggle without some form of documentation.

 

There are ways to read the public functions listed in a dll library (see this link at StackOverflow, or Google for more specific results)

 

If you're still waiting for Canon to give you the SDK officially, that might be better than trying to get information out of the dll directly - I expect that will be a difficult task that makes a tricky undertaking very tedious. With documentation, it should be much simpler, as I described above.


GCentral
0 Kudos
Message 3 of 6
(5,502 Views)

I would wait for the SDK, also.  At least the calls will be documented.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 4 of 6
(5,489 Views)

@Abuzar wrote:

Hi,

I am not an expert of LaBVIEW. I wanted to interface Canon Camera with LabVIEW. I tried to use this toolkit I tried using Third Party Software to interface it but the program intiiates with many errors. 

I am attaching the list of errors so that you can also check it.

Finally i have decided to interface the canon camera using its own SDK, i have written to the Canon.

To use the canon SDK i need some guidance on how an SDK could be used in LABVIEW and how can I control the functions of Camera using the Canon SDK.

I therefore would like to request you to please guide me through the procedure.

I shall be highly thankful to you.

Regards


Those aren't errors, they are warnings.  They are telling you that stuff loaded from an unexpected path.  Is this the only thing keeping you from using the software?  It would also be helpful if you opened up that dialog and looked at which files were affected.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 5 of 6
(5,485 Views)

The Canon DLLs are not in a way that you could call them directly from LabVIEW with the Call Library Node. Some of the things like callbacks simply won't work, and many other things require you to play C compiler in the LabVIEW diagram in order to get the data structures just in the right way to be able to call the Canon SDK DLL in a way that will not crash.

 

So in that sense, I would strongly recommend to keep investigating the 3rd party Toolkit and only choose the SDK path if you absolutely have to. But a warning ahead, if you don't own very in depth C programming knowledge know, be prepared to learn it before you start to go down that route. There is no way around it! Trying to avoid to have to write a wrapper DLL in C yourself, will in fact require even more in depth low level knowledge about how a C compiler really works. By writing a wrapper DLL you can avoid a bit of that low level knowledge and let the compiler do the hard work. Still if you do not understand pointers and function pointers in C to a pretty intimate level, it's never going to work, both with or without wrapper DLL.

Rolf Kalbermatter
My Blog
0 Kudos
Message 6 of 6
(5,463 Views)