Jump to content

Connecting Labview and Java?


Recommended Posts

We currently have a fairly standard test station setup that consists of a computer running Labview, a mechanical actuation system, and a device under test (DUT.) Labview sends commands the the mechanical system via a motion controller telling it how to interact with the DUT. The DUT then sends data back to Labview via a USB-8451. The data loop looks like:

Labview -> Mechanical System -> DUT <--> Labview

I have just received a request to use this test setup to test some new prototypes; however, in the prototypes the DUT firmware is being emulated by a Java application running on a pc. The conceived data loop looks like:

Labview -> Mechanical System -> DUT -> Java Application <-?-> Labview

Before I knew the firmware emulation was written in Java I suggested the developer strip the UI and package the functions in a dll so I could wrap it in a vi and implement it directly in my Labview app. AFAIK, dll's can't be created from Java apps. (But I have no experience with Java so I don't really know.) I'm not too fond of have the two applications running simultaneously; getting them to communicate reliably seems like a great way to get in over my head. (Read - take me a really long time to do.) I'm also worried that route will introduce too much latency when Labview requests a piece of data from the DUT.

Unfortunately I don't know Java and the firmware emulation developer doesn't know Labview so at the moment we're looking at each other across a chasm trying to figure out how to bridge it. Anyone have ideas to get me pointed in the right direction?

Link to comment

QUOTE(MikaelH @ Aug 21 2007, 06:43 PM)

Colleagues of mine have had just the problem; the Java Application was controlling a telecom base station.

The solution was to send XML-typed data through TCP/IP.

//Mikael

yes, i can confirm.

I and a collegue of mine had developed a simple protocoll (XML and TCP based) and a couple of libs, one for labview and one for java, to enable this kind of communication.

We use these functions for example for monitoring FP acquisition values due a web browser running a Java Applet and also the libs for building a huge system were labview is the scheduler and java is the UI.

Using XML we are able to modify, and also extend the protocol changing only a single XML file and whitout touching the codes.

Ciao

Link to comment

QUOTE(Daklu @ Aug 21 2007, 11:58 PM)

Yikes! That sounds ugly. Thanks for the tip--guess I'd better break out the help files.

It shouldn't be that ugly, once you determine what commands and information need to be sent back and forth between LV and the JAVA app you will have a finite set of rules to handle. Simply watch the port for a command and length of data then wait for the correct number of bytes to come through and digest them in the proper state.

How big is the list of possible interactions between the Java app and LV?

Link to comment

Right now the list is very small. Labview will request a data packet and the Java app will send it. That's it.

I'll take your word that's it's not ugly but I'm an engineer, not a programmer, and this is outside anything I've ever done before. I suppose I have to start climbing the learning curve sometime. :)

(Anyone have simple sample code they can post?)

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.