LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Connecting LabView gui to an existing java code and sending information between a jar and a labview application.

I am tasked with connecting a LabView application with a java code base. I am completely ignorant on how I am to get information to be shared between the LabVIEW application and the java code. Any information or resources would be appreciated.

0 Kudos
Message 1 of 4
(2,828 Views)

What you're describing is known as inter-process communication (IPC). There are multiple methods depending on what you need to communicate, including files, shared memory, network sockets, pipes and so on.

 

Without knowing much about the Java code, a simple messaging scheme via a local TCP/IP socket is probably where I'd start. The Java code base would need something to handle the TCP/IP messaging, call the appropriate Java functions, then return the result back to LabVIEW via the TCP/IP socket. On the LabVIEW side would be a similar network messaging function, sending commands and receiving responses.

 

There are lots of libraries and toolkits for handling IPC which may be better suited to what you're trying to achieve.

 

This thread may also be helpful.




Certified LabVIEW Architect
Unless otherwise stated, all code snippets and examples provided
by me are "as is", and are free to use and modify without attribution.
0 Kudos
Message 2 of 4
(2,775 Views)

I have been trying to use the built in TCP protocol on LabVIEW to accomplish this, but the Java code uses a Modbus protocol to accomplish its network communication. Is TCP sufficient to communicate in this network? Or will I have to enable Modbus capabilities in my LabVIEW?

 

Note: My LabVIEW is in a Linux environment and I have had difficulty with enabling the Modbus library. 

0 Kudos
Message 3 of 4
(2,715 Views)

Does the Java code already have an external interface allowing calling via modbus, or is that just the setup for its (effectively internal) work with hardware systems? 

 

If you have an existing interface, use that. If not, you'll presumably need to create one in your Java code, so you can choose to use modbus or tcp or any other preferred method. 

 

You might also be able to consider something like JNI to call your Java code more directly? 


GCentral
0 Kudos
Message 4 of 4
(2,693 Views)