1

Having trouble calling a DLL method from Corelis Jtag USB-1149.1_1E from Java, even though I could call it from labview. In the Corelis user guide scan_multiple has five arguments. But data_in is a return value, and therefore, I don't think it should be an argument/input. How should I structure my scan_Multiple() in Java? How many arguments?

Document:

int scan_Multiple(const long n_commands,const unsigned long *method,const unsigned short *data_out,unsigned long *bit_length,unsigned short *data_in)

Code:

public class HelloWorld {

    public native int scan_Multiple(long n1, long n2, short n3, long n4, short n5);

    // private native void print();
    public static void main(String[] args){
        System.loadLibrary("usb1e_sfl_x64");
        HelloWorld sample = new HelloWorld();
        System.out.println("test1");
        long n1 = 1000;
        long n2 = 1000;
        short n3 = 2;
        long n4 = 2;
        short n5 = 2;
        System.out.println(n1 + " " + n2 + " " + n3);
        int test222 = sample.scan_Multiple(n1,n2,n3,n4,n5);
        System.out.println("test2" + n1 + n2 + n3 + n4 + n5 + test222);
        // usb1e_sfl_x64 sample = new usb1e_sfl_x64();
        // int test = sample.scan_multiple
    }
    static{
        // System.loadLibrary("usb1e_sfl_x64");
    }
}
Peter Gordon
  • 1,075
  • 1
  • 18
  • 38
sifangyou
  • 175
  • 1
  • 2
  • 6

1 Answers1

0

Try to box data_in with a class wrapper

Short n5;

this way the parameter will be passed by Reference, and should have on function return the desired data.

Alex
  • 779
  • 7
  • 15