|
hantek开发工程师:
你好。我们所采购了你们的6104EU示波器。目前想把采集的电压数据集成在我们的系统里,所以调用你们的DLL链接库的dsoHTCollectDataWave接口取电压数据。代码部分如下:
IntByReference[] a1 = new IntByReference[100];
IntByReference[] b1 = new IntByReference[100];
IntByReference[] c1 = new IntByReference[100];
IntByReference[] d1 = new IntByReference[100];
int dsoHTCollectDataWave = new JNADllCall().dsoHTCollectDataWave(tmpDeviceIndex, a1, b1, c1, d1, 100);
for (int i = 0; i < a1.length; i++) {
if (a1[i] != null)
System.out.println("电压" + i + "=" + Pointer.nativeValue(a1[i].getPointer()));
}
在调用接口的时候,如果直接调用dsoHTCollectDataWave提示找不到function。用DLL查看器发现实际有效的的是_dsoHTCollectDataWave@24接口。用此接口调试正常,也有数据反馈,但是采集的数据不太对。例如通道a1返回数据如下:
电压0=8192125
电压1=8257661
电压2=8257662
电压3=8257662
电压4=8192126
电压5=8257661
电压6=8257662
电压7=8257662
电压8=8192126
电压9=8257661
电压10=8257662
电压11=8257662
电压12=8257662
电压13=8192125
电压14=8257662
电压15=8257661
电压16=8192125
电压17=8257662
电压18=8257662
电压19=8257662
电压20=8192126
电压21=8257662
电压22=8257661
电压23=8192126
电压24=8257661
电压25=8192126
电压26=8257661
电压27=8192126
电压28=8192126
电压29=8257662
电压30=8257662
电压31=8192126
电压32=8257661
...........
电压45=8257662
电压46=8257662
电压47=8257661
电压48=8257661
电压49=8192125
请问下用java调用如何才能返回正确的电压数据?麻烦贵公司技术人员指导下,非常感谢。
|
|