Strange unit info in Java

Post your Java discussions here
Post Reply
mikeg
Newbie
Posts: 0
Joined: Wed May 15, 2013 1:01 pm

Strange unit info in Java

Post by mikeg »

Hey there.

I'm writing a java application to use the Picoscope 2204 for data gathering. To communicate I use the JNA for creating a library with the dll.

Opening the Osciloscope is working. For the 2nd step I tried to read the Variant Info with the ps2000_get_unit_info function.
It seems to work but the problem is I can't read it because it seems to be in chinese or something like that.

Code: Select all

  
        lin = 3;
        info = new char[length];
        OLibrary.INSTANCE.ps2000_get_unit_info(handle1, info, length, lin);
        for(int i = 0;i
And I get this output:
㈲|㐰|
Is there something I'm doing wrong? Or could it be the language of the device is something asian?

Help is much appreciated

Best regards Mike

Hitesh

Re: Strange unit info in Java

Post by Hitesh »

This topic has been moved to the Java area:

http://www.picotech.com/support/topic12171.html

Hitesh

Re: Strange unit info in Java

Post by Hitesh »

Hi mikeg,

I've not used JNA myself but there is an example using JNI on this forum which does work, which suggests that it might be the way JNA is interpreting the character arrays being written to.

When using JNI, the character array written to by the ps2000_get_unit_info function is converted to a UTF String - does JNA do this?

Looking at data types, perhaps you can use char* which maps to a Java String?

Regards,

Post Reply