JAVA JNI Channels (channel id) missing when reading data

The free CAN Software API (Application Programming Interface) for Windows®
Locked
Philipp2
Posts: 8
Joined: Sun 1. Oct 2023, 17:01

JAVA JNI Channels (channel id) missing when reading data

Post by Philipp2 » Wed 11. Oct 2023, 15:14

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
Attachments
3 channels are missing
3 channels are missing
bild2.jpg (419.94 KiB) Viewed 5447 times
all 4 channels are read correctly
all 4 channels are read correctly
bild1.jpg (155.16 KiB) Viewed 5447 times

Philipp2
Posts: 8
Joined: Sun 1. Oct 2023, 17:01

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

Post by Philipp2 » Thu 12. Oct 2023, 18:08

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

User avatar
PEAK-Support
Sales & Support
Sales & Support
Posts: 1646
Joined: Fri 10. Sep 2010, 19:34

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

Post by PEAK-Support » Fri 13. Oct 2023, 08:24

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"
--------------------------------
PEAK-System Technik
Technical Support Team
support[at]peak-system.com
-------------------------------

Philipp2
Posts: 8
Joined: Sun 1. Oct 2023, 17:01

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

Post by Philipp2 » Fri 13. Oct 2023, 11:03

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.

User avatar
PEAK-Support
Sales & Support
Sales & Support
Posts: 1646
Joined: Fri 10. Sep 2010, 19:34

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

Post by PEAK-Support » Fri 13. Oct 2023, 15:48

PCANBasicExample.exe gets all 4 can-id.
OK - we will check it and come back soon with a solution...
--------------------------------
PEAK-System Technik
Technical Support Team
support[at]peak-system.com
-------------------------------

Philipp2
Posts: 8
Joined: Sun 1. Oct 2023, 17:01

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

Post by Philipp2 » Sat 14. Oct 2023, 15:17

thank you! I'm in vacation until 1.11.

Philipp2
Posts: 8
Joined: Sun 1. Oct 2023, 17:01

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

Post by Philipp2 » Thu 2. Nov 2023, 14:01

hello,

have you found a solution already?

best regards - Philipp

User avatar
PEAK-Support
Sales & Support
Sales & Support
Posts: 1646
Joined: Fri 10. Sep 2010, 19:34

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

Post by PEAK-Support » Thu 2. Nov 2023, 14:55

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.
--------------------------------
PEAK-System Technik
Technical Support Team
support[at]peak-system.com
-------------------------------

Philipp2
Posts: 8
Joined: Sun 1. Oct 2023, 17:01

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

Post by Philipp2 » Mon 6. Nov 2023, 13:04

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

User avatar
PEAK-Support
Sales & Support
Sales & Support
Posts: 1646
Joined: Fri 10. Sep 2010, 19:34

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

Post by PEAK-Support » Mon 6. Nov 2023, 13:11

Thank you for the feedback - we will processing with creating a release candidate and update our files soon.
--------------------------------
PEAK-System Technik
Technical Support Team
support[at]peak-system.com
-------------------------------

Locked