LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Insert .dll File Ocean Optics Jaz

Solved!
Go to solution

Hi there,

 

I want to use the spam package (Ocean Optics) in Labview 2009. But I have no idea how to use the .dll file in Labview. I found already tools>>import>>shared library.

Insert the SPAM32.DLL file. But in the same menu you must also insert a header file. But where can I found this one? Or do I something wrong?

 

Could anyone help me with this?

 

Stephan

0 Kudos
Message 1 of 8
(3,506 Views)
Solution
Accepted by topic author Stephan1204

Finally I found the answer

0 Kudos
Message 2 of 8
(3,494 Views)

Hello Stephan,

I am currently facing the same problem.

It would be great if you could post your solution.

 

Thank you!

 

 

0 Kudos
Message 3 of 8
(3,409 Views)

Hello ra.graf1988,

 

I do not know what this Ocean Optics DLL is about, however I can help you using a DLL with LabVIEW!

 

The first thing is that when you want to call a DLL, you need to know some information about that DLL. Mainly, you need to know the calling convention, the thread safety and the functions prototypes (i.e. the names of the functions along with the input and output parameters data types). That information should be located somewhere on the documentation of the Ocean Optics package.

 

When you know that, you have two possibilities to use the DLL: either use the Import Wizard to create a library with wrapper VIs for all the functions of the DLL, or use a the "Call Library Function" node to access the function you need on the DLL.

If you want to go for the first option, then you need indeed a header file. This file is just a C file containing the prototypes of all the functions you want to import. If you do not have such a header file, you can create it yourself (from the documentaion of the DLL).

 

Here are some more information for the first method (with example of header file): https://decibel.ni.com/content/docs/DOC-9078

and for the second method: https://decibel.ni.com/content/docs/DOC-9069

 

Let me know if you need more information.

Cédric | NI Belgium
0 Kudos
Message 4 of 8
(3,397 Views)

Hello Cedric,

thank you for your help and the websites you posted.

I read through it and tried to apply it on my problem.

 

Here is the function i want to call:

 

public static double[] processSpectrum(double[] dark,

                                                          double[] sample,

                                                          double[] wavelengths,

                                                          double[] calibration,

                                                          double integrationTimeSeconds,

                                                          double collectionArea,

                                                          boolean integrating Sphere)

 

My first problem is, that i cannot use an array type for the return value.

The double[] and double variables are straight forward, but I am also not sure what type to use for the boolean variable.

I found that I can use a uint8. Is that correct?

 

greets

 

Rainer

0 Kudos
Message 5 of 8
(3,392 Views)

Hello Rainer,

 

Do you have more information on the DLL? Do you know in which language is written the DLL? Where does the prototype come from? Did you finally find a header file?

 

Let start with the easy one. Yes, for the boolean, a uint8 should work.

 

But to return an array, it will be a bit more tricky. To properly answer you, I need to know what is the exact representation of the array at the output of the DLL, and that depends on the language.

Usualy, this is done by passing a reference to the array. It is then possible to access the values located at that reference (this is called dereferencing). 

You can have more information on the dereferencing process a that location: https://decibel.ni.com/content/docs/DOC-9091

 

But as I said, it can be a bit tricky to configure everything properly, depending on the DLL you have and how it is implemented.

Can you share the DLL in order for me to do some test? Some documentation is also welcome!

 

Cédric | NI Belgium
0 Kudos
Message 6 of 8
(3,369 Views)

Hey,

Ok i think the dll is from Java Code. It is part of the Omnidriver+SPAM package from OceanOptics.

The Prototype comes from the javadoc, which was inside the package.

I found a header file, but it seems that i dont have the programms to open it correctly. It looks like my Windows machine at work cannot display it correctly. But my Linux machine at home can. I will try to post it when i am at home.

 

I am not really sure what I can post here online, because we purchased the package....

0 Kudos
Message 7 of 8
(3,364 Views)

Hello all,

 

I have the sampe problem.

Has anyone can help me solve this?

 

Thank you.

0 Kudos
Message 8 of 8
(3,301 Views)