Please select To the mobile version | Continue to access the desktop computer version

Electronic Engineer Discuss

View: 5277|Reply: 1

6104EU用java jna 调用动态链接库取电压数据问题

[Copy link]

1

Threads

1

Posts

1

Credits

新手上路

Rank: 1

Credits
1
Post time 2021-5-25 09:44:27 | Show all posts |Read mode
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调用如何才能返回正确的电压数据?麻烦贵公司技术人员指导下,非常感谢。
Reply

Use magic Report

102

Threads

340

Posts

512

Credits

超级版主

Rank: 8Rank: 8

Credits
512
Post time 2021-5-27 14:48:47 | Show all posts



关于Java的调用请参考VC++ demo;
You have to log in before you can reply Login | Register

Points Rules

Dark room|Mobile|Archiver|Electronic Engineer Discuss

2024-3-29 22:36 GMT+8 , Processed in 0.154917 second(s), 21 queries .

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

Quick Reply To Top Return to the list