Page 1 of 1

JAVA JNI Channels (channel id) missing when reading data

Posted: Wed 11. Oct 2023, 15:14
by Philipp2
Hi,

thanks to you, I got my java program connected to the PCAN FD system yesterday and thanks to your netbeans program provided I could overcome the TPCANStatus.PCAN_ERROR_QRCVEMPTY message I got after some time always.

And learned I can read meassages two wasy: myself or event driven by JNI interface if receive-events are detected.

But reading data with a while(true) loop or event driven, channels are missing.

Situation:
===========

- It's a PCAN-MicroMod-FD connected to PCAN-PCI Express FD.

- 4 channels are programmed with one ad-converter each. PCAN-View works fine, see fig1 attached.

In my java programm, I am receiving one channel only (id=300h). I assumed first, it's my fault, but checking the connection with the netbeans application you have provided (fig2), it's the same.

Therefore, I assume, the problem must be somewhere else, maybe it's the window version (actual Win10) or the java (java 17) or something else, hopefully you can help. The goal of the software shall be to collect all data incoming like in the .trc-files written by PCAN-View when connected.

best regards - Philipp

Re: JAVA JNI Channels (channel id) missing when reading data

Posted: Thu 12. Oct 2023, 18:08
by Philipp2
By the way, what is better:

while(true) loop to read data

or

event driven by JNI interface if receive-events are detected?

do you suggest one method?

best wishes Philipp

Re: JAVA JNI Channels (channel id) missing when reading data

Posted: Fri 13. Oct 2023, 08:24
by PEAK-Support
Event driven is always better - you also do not read directly the CAN Hardware, you read the queue from the driver that was created for your application.

We do not see your problem receiving only one single CAN-ID (it is no "channel" it is a CAN-ID ) i just try it here - works without any problem...
Please try the binary sample (exe) that comes with the package (could be found in the x86/x64 folder) - do you see the same "problem"

Re: JAVA JNI Channels (channel id) missing when reading data

Posted: Fri 13. Oct 2023, 11:03
by Philipp2
PCANBasicExample.exe gets all 4 can-id.

maybe i should try another java version? I have not changed your netbeans java application, just compiled and run.

Re: JAVA JNI Channels (channel id) missing when reading data

Posted: Fri 13. Oct 2023, 15:48
by PEAK-Support
PCANBasicExample.exe gets all 4 can-id.
OK - we will check it and come back soon with a solution...

Re: JAVA JNI Channels (channel id) missing when reading data

Posted: Sat 14. Oct 2023, 15:17
by Philipp2
thank you! I'm in vacation until 1.11.

Re: JAVA JNI Channels (channel id) missing when reading data

Posted: Thu 2. Nov 2023, 14:01
by Philipp2
hello,

have you found a solution already?

best regards - Philipp

Re: JAVA JNI Channels (channel id) missing when reading data

Posted: Thu 2. Nov 2023, 14:55
by PEAK-Support
please send a short e-mail to support[at]peak-system.com - we will send you a secure link with a pre-release version.
Before we make a release version we have to do many other QC test up in front...so there is no public link available at the moment.

Re: JAVA JNI Channels (channel id) missing when reading data

Posted: Mon 6. Nov 2023, 13:04
by Philipp2
Hi,

replaced the ddls and used the java test application (NetBeans project) you have send and its working now, all 4 channels are read now! many thanks!

I also checked my own application, which still uses the old java peak.can.basic package and its working too. the significant change must be within the dlls

best regards - Philipp

Re: JAVA JNI Channels (channel id) missing when reading data

Posted: Mon 6. Nov 2023, 13:11
by PEAK-Support
Thank you for the feedback - we will processing with creating a release candidate and update our files soon.