08-01-2019 05:35 PM
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.
08-01-2019 09:07 PM
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.
08-06-2019 10:20 AM
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.
08-06-2019 12:28 PM
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?