sganap Posted May 27, 2006 Report Share Posted May 27, 2006 If I want to send a digital signal from java to Labview VI to trigger a DAQmx device, that takes in I/O from dev1/port0/line:7. Any insight will be greatly appreciated. -Sganapat Quote Link to comment
oskarbosch Posted May 30, 2006 Report Share Posted May 30, 2006 Had a project here where we combined Java and LabVIEW. Did not have much problems getting values to LabVIEW. Just make a DLL in labview and call the DLL from Java. (you can find many source examples how to call DLL's in Java, it means writing an intermediate C dll that converts between a java style DLL and a generic windows style DLL which is what LabVIEW exports). We made a DLL that starts up a server part in the background. This server would take care of all the hardware communication. The main issue we had though was passing back big arrays. This caused some errors in the JVM, which we still have not resolved. Seemed to be timing related... But passing simple values was no problem. Hope this helps, Oskar Quote Link to comment
jma_1 Posted June 2, 2006 Report Share Posted June 2, 2006 If I want to send a digital signal from java to Labview VI to trigger a DAQmx device, that takes in I/O from dev1/port0/line:7.Any insight will be greatly appreciated. -Sganapat A few approaches come to mind on how to accomplish sending a signal from java to trigger a DAQmx device: 1) Create an executable of your Labview code. Use a system call from your java code (assuming it's an not an applet) to launch the executable (trivial). This is the simplest, but is limited by your task (passing data, etc.). 2) Wrap your java code using the JNI interface. Have your Labview code make a call to your java application and check if the task should trigger (CIN node? dll, or similar). If you like puzzles, this is a fun one to try. If you are comfortable using java and C/C++, this would work. 3) If you are deploying this to a desktop, does the computer have multiple serial ports, parallel ports, or USB ports? If yes, perhaps you can use the javax.comm package and loop two ports together. Setup your Labview code to listen for a specific message and then trigger the event. If this works, it would be trivial to pass data back and forth between java and Labview. This is by no means an elegant solution, but it will work reliably and is fairly trivial. I've used the javax.comm package with 115200 baud with good success. Without more specific data on your particular application, these are all the suggestions I have. Cheers JMA Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.