I now have a nice setup to run test scripts using DSS with rhino javascript. My problem is that I need to generate analog and digital inputs to my unit under test, and I need to monitor analog and digital outputs that the unit under test generates. To this end, I have a National Instruments DAQ that communicates over a USB connection with the PC running DSS and rhino javascript. What I now need is a way to integrate inputs and outputs associated with the NI-DAQ into my javascript test scripts.
The DAQ comes with a dll that has C functions to communicate with the DAQ. My thought was to use SWIG <http://www.swig.org/Doc1.3/Java.html> to build a JNI interface to the DAQ dll, and then import the SWIGged functions into javascript where I could use them to operate the DAQ seamlessly right along with the rest of the DLL functionality.
My problem is I am not a java person. I have used SWIG before with python and with perl, but using it with java is a bit different. Another barrier is that while I have header files to interface to the DAQ dll, I do not have any other sources for the DAQ library; therefore, I cannot build a dll with the DAQ functions that also has the JNI to support the java interface. Will I have to build a jar file for the JNI interface so rhino javascript can see it, or will javascript be able to see the dll directly since it is visable from within the java runtime? Will I have to invoce System.loadLibrary("DAQ") from within my javascript to get the dll to load and become accessable, or must this be done from within the java environement?
Is this whole approach even feasible? Has anyone done this before?
Thanks!