07-16-2013 12:15 PM
Greetings,
I am very new to LabView and have a Java programming background.
I have to put together a way to submit a String to a LabView vi on a remote computer. The Labview should then return another String to my Java program. I just need an example of calling this on the remote computer. I've seen many looping and circular references to doing it via JNI, but not much that shows a concrete example.
Does anyone have a working example of opening the socket (or datagramsocket or whatever), writing to the socket, receiving the response and then closing the socket?
Thank you.
07-16-2013 05:10 PM - edited 07-16-2013 05:24 PM
JNI won't really help for remote invocation. With JNI you would normally create a DLL for the local computer that interfaces to whatever you want to call.
But considering your mentoining of remote calls, I think it would be easier to implement on the LabVIEW side some TCP/IP server and just call that from your Java program using socket calls.
LabVIEW comes with a few networking examples. Check in the example finder for them. Doing the Java part shouldn't really be to difficult either. The fact that both LabVIEW and Java use Network Byte order by default for their flattened data also comes in handy.