Measurement Studio for VC++

cancel
Showing results for 
Search instead for 
Did you mean: 

DAQmx with C JNI Java

Solved!
Go to solution

Hello,

 

I'm a newbie with a big problem:

I need to write some ANSI C DAQmx functions (for example DAQmxCreateTask, or DAQmxStopTask) in Java using the "Java Native Interface" JNI.

My Problem is the TaskHandler.

How do I get the TaskHandler into Java?

For Example: I write two Java native Functions "Java_DAQmxCreateTask" and "Java_DAQmxStopTask". OK - But to stop the task i need to know the TaskHandler in Java.

 

Is it possible to convert the TaskHandler to a jint or a jdouble or jlong datatype and use the return value from my "Java_DAQmxCreateTask" function for the paramenter in the "Java_DAQmxStopTask(taskhandler)" function? Or is there a way, to create a TaskHandler in Java?

 

Example java code:

 

taskHandler = Java_DAQmxCreateTask(.....)

...

Java_DAQmxStopTask(taskHandler)

 

 

thank you very much for your support

and best regards

 

0 Kudos
Message 1 of 2
(7,498 Views)
Solution
Accepted by topic author mesX

Hi again,

 

i fixed it by myself.

i just converted the TaskHandler with (long).

 

regards

0 Kudos
Message 2 of 2
(7,488 Views)