Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

GPIB with Java

Hi! I would like to use NI's GPIB cards in a Java program, which is not supported
by NI. Is there any library etc. which makes the functions in gpib-32.dll
available for programming in Java? This should work e.g. with J/Direct, but
since I'm a beginner to Java I would like to find a solution that already
works.

Thanks, Till
0 Kudos
Message 1 of 10
(16,235 Views)
I also need to use NI's GPIB cards in a Java program, which is not supported
by NI. Is there any library etc. which makes the functions in gpib-32.dll
available for programming in Java?
 
Pls advise and email me at wei-leong.ee@amd.com or merlion_78@hotmail.com
 
 
0 Kudos
Message 2 of 10
(15,957 Views)

Hi,

As you know, Java is not supported by NI, but here is a KnowledgeBase that describes where to start. I wish I had a better answer for you.

Regards,

Missy S.
Project Engineer
RoviSys
0 Kudos
Message 3 of 10
(15,922 Views)
At one point I created enough of a wrapper using the Java Native Interface just to see if I could do it.  I was able to perform a simple Read and Write using NI-VISA, but in my mind it would be easier just to use another programming language.

As there a particular reason you have to use Java?

-tuba
0 Kudos
Message 4 of 10
(15,890 Views)
This is a great topic.

Java offers some compelling advantages - true OO language, great portability, code re-use, free development tools, great class library, etc.  Some big players are putting effort into the Real Time Specification for Java (RTSJ) which puts Java into the test system solution space. 

I think it would be way cool if NI provided Java bindings for their libraries - what could it hurt?  But - Java is a language specification, a compiler, a development framework, and a runtime system - and NI sells this (except for the C language spec) as their development product (CVI).

I don't think we'll ever see the RTSJ implemented on a Win32 system though, so that might put something of a damper on the whole thing.  But for systems that don't need full determinism (e.g. anything running on Win32(not counting CE)) Java just seems like a good idea.  Java is used as the teaching language any many major universities, new graduates view OO as the normal way to program.

I know I get really really tired of cranking out gobs of C code, and novice developers commonly shoot off their foot mishandling the C language.  And in C++ they can blow off their whole leg.   And VB isn't an OO language.   I suppose you could say use C# - after all, it's a total Java rip-off -  but it's still a Microsoft proprietary language that they'll manipulate to further their profit motive - not yours.

Menchar

Message Edited by menchar on 09-06-2006 11:20 AM

0 Kudos
Message 5 of 10
(15,827 Views)
tuba, could you post or e-mail your jni wrapper of NI VISA?  My e-mail is jwherhol@retrodict.com.  Thanks.
0 Kudos
Message 6 of 10
(15,673 Views)
Hmm...it was so crude and incomplete that I wouldn't be willing to post it.  I found a link that provides a step by step example of creating a wrapper for a GPIB function, this is the same process I used with VISA, and you could follow it to make your own wrapper for the functions you need.

-tuba
Message 7 of 10
(15,652 Views)

That link is not working anymore. The subject is very interesting. Could anyone share any experience or info about Jni and Visa?

0 Kudos
Message 8 of 10
(10,810 Views)

Instead of using Java look into using Python. Python has a PyVISA module that will let you communicate and control test equipment via GPIB, USB and RS232. PyVISA provides bindings to the VISA library and PyVISA and Python are free. Another nice part is that Python is very similar to Matlab in handling vectors, matrices and plotting.

 

Just google Python and PyVISA and you'll be running in no time.

0 Kudos
Message 9 of 10
(10,713 Views)

Do you still have the java code?

Could you please sent it to my address? edemf3@gmail.com

0 Kudos
Message 10 of 10
(6,247 Views)