LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Controlling LabVIEW VIs from JAVA

I am an embedded programmer and I write drivers for microcontrollers. Recently I had come up with an idea of creating a test suite for my drivers using JAVA. I have decided to use JAVA for making my Test Suite independent of the platform. My requirement is to measure the digital signal output from the evaluation board and capture it using LabVIEW. I am having LabVIEW 8.6 and I use NI-RIO device for this purpose. For data analysis and measurement, I need the acquired/measured data in my JAVA Test Suite application.

Initially I wrote a native code in C++ which imports the LabVIEW Type Library and used this to read the values captured by LabVIEW. Further I made use of JAVA Native Interface (JNI) to read these values for comparison in my Test Suite.

This was the best possible solution I came up with from my knowledge. But there is a catch in this approach. I am calling LabVIEW by way of ActiveX which makes my Test Suite platform dependent. If my understanding is correct, this can only be done on Windows.

I have also looked into Shared Libraries that LabVIEW supports on different platforms. With Shared Libraries, the user or my Test Suite is not given privilege to load a VI, set the input control values, and stop the VI etc. This is again a problem as my Test Suite will have to be changed depending on the platform.

Web service is again platform dependent as NI says that this is available only on Windows.

My requirement is to create an interface between JAVA and LabVIEW so that I can control a VI, load the VI, set the input control values for the VI and receive the output values from the VI.

If there is a better way to implement this; can anyone please advice me?
0 Kudos
Message 1 of 4
(2,765 Views)

Hi Arun Raj, as you said, Active X would work just in LabVIEW. An easy way to implement communication between Java and LabVIEW would be through TCP/IP, you could write and send the information to the same computer. This should be platform independent.

Why don't you develop the suit in LabVIEW? LabVIEW can run on Windows, Mac and some Linux distributions?

Best Regards.

Benjamin C
Principal Systems Engineer // CLA // CLED
0 Kudos
Message 2 of 4
(2,689 Views)
As mentioned in the previous post, use TCP/IP. I do this successfully using a TCP socket connection between Java and Labview. This works out very well and I believe is easier than using JNI. I use a command/response protocol to send commands to Labview from my Java app.
0 Kudos
Message 3 of 4
(2,605 Views)

Hey,

Pleace i can t link java and labview using tcp/ip !! Can you help ?

0 Kudos
Message 4 of 4
(922 Views)