LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

port JAVA to labVIEW

I have some JAVA code I would like to port to labVIEW.  Is there any literature regarding this?
0 Kudos
Message 1 of 9
(5,324 Views)

No.

 

You're just going to have to figure out what the Java code is doing and duplicate its functionality in LabVIEW.

0 Kudos
Message 2 of 9
(5,315 Views)

Hello eearle,

 

I have the same guestion. How did you go about  doing the same?

 

Thanks,

 

H.

0 Kudos
Message 3 of 9
(5,188 Views)

You basically sit down with the Java source and draw out its functionality in whatever notage your most comfortable, flow diagrams, flow chart, whatever. Then you sit down with your LabVIEW development system and try and recreate the functionality, remembering that LabVIEW is a data flow language, but that it can do things in parallel easily that are difficult in other languages.

 

If the program your are trying to duplicate is complex it will be a non-trivial task, particularly if the source is not well documented, and/or you aren't familiar with both Jave (or C++ or VBasic, etc.) and LabVIEW.  Good Luck!

Putnam
Certified LabVIEW Developer

Senior Test Engineer North Shore Technology, Inc.
Currently using LV 2012-LabVIEW 2018, RT8.5


LabVIEW Champion



Message 4 of 9
(5,182 Views)

Hello,

 

Given that the Java code is complex, I was thinking of using Java Invocation Interface  that will help calling Java methods into C++  and then creating a shared object from c++, which can be imported in Labview.

 

I am however getting the following error while importing the shared object into LV:

"

The following header file was not found in the specified header file or one of the referenced header files:
-  string
-  iostream
-  cstring
-  jni.h

"

 

Are there any documents or resources that may be helpful.

 

Thanks.

 

-H

0 Kudos
Message 5 of 9
(5,174 Views)
You can try searching for JNI. I have no experience with Java, but if memory serves, going down this road was not highly recommended.

___________________
Try to take over the world!
0 Kudos
Message 6 of 9
(5,157 Views)

H P,

 

       There are really two avenues you can go down when trying port Java code to LabVIEW:

 

1) You can build a DLL that hosts the JVM and uses the JNI interface to call Java Methods and then call that DLL in LabVIEW.

 

2) You can convert the .class or .jar files into .NET and then use .NET support in LabVIEW to call it (more info on .NET in LabVIEW here https://www.ni.com/docs/en-US/bundle/labview/page/using-net-assemblies-with-labview.html)

 

Overall, I think that the dll route would be better because dll support in LabVIEW is good but you have to figure out all the JNI and JVM stuff on your own. I'm not intimate with Java by any means but these were the two methods I have seen customers use and more customers use the first option more. As far as functionality in LabVIEW, I don't know if either one is better than the other. Hope this info helps! 

0 Kudos
Message 7 of 9
(5,134 Views)

I also have same problem, any one can help me out

AB
Kudos are Accepted
0 Kudos
Message 8 of 9
(3,960 Views)

discussion continued here

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 9 of 9
(3,937 Views)