LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Question about using LabVIEW with Java

Hi,


I am currently working on a Java project where I am required to take a LabVIEW
application (called MultiTauCorrelator) and call it from a Java application.
After looking around, I found that I had to use the JNI to create a wrapper dll
for the LabVIEW application. However, I am not familiar with the JNI, or how to
use it with LabVIEW. 
Would anyone happen to know how to call the methods from the LabVIEW application
from Java? I realize that there are already several similar threads, but I did not understand them. Thanks for the help
0 Kudos
Message 1 of 6
(3,177 Views)

I don't know what JNI is, but why can't you use LabVIEW to create the .dll of the LabVIEW application?  It is one of the options under Build Specifications in the project explorer.

0 Kudos
Message 2 of 6
(3,173 Views)

I did do that, but after that, since I want to call the methods in a Java program, I have to use the Java Native Interface (JNI) which allows you to call non-Java code from Java

The only problem is, I dont know how you would do that for LabVIEW specifically (I have only seen it described for code in C or C++)

 

0 Kudos
Message 3 of 6
(3,170 Views)

You have to make a distinction and/or clarification about exactly what you're trying to do. If you want to compile some LabVIEW code into a DLL then you can do that and use JNI within your Java class to access the LabVIEW DLL as you would other DLLs. The target machine would require the LabVIEW Run-Time Engine. If, instead, you are trying to control a GUI-based LabVIEW application then you're really talking about using the VI Server to control the LabVIEW application. On Windows you would do this by enabling the ActiveX server for the application build spec and then access the application from Java using ActiveX.

 

So, which way are you trying to do this?

Message 4 of 6
(3,164 Views)

After reading your reply, I realize that its the second way that I should be using. 

Do you have any advice for how to do that?

Thanks for your help

0 Kudos
Message 5 of 6
(3,161 Views)

Advice on which part? Enabling ActiveX support, or calling ActiveX from Java? If it's the first, then you enable the ActiveX server for a build spec in the Advanced page of the build spec's properties. If it's the latter, I'm afraid you're going to have to go to Java forums or look up some Java tutorials on calling ActiveX from Java.

0 Kudos
Message 6 of 6
(3,132 Views)