LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I read/write to/from shared variables in other languages like java?

Hello,

 

I have some cRio devices that need to be controlled and provide data through labview.

 

I have set up a FPGA Vi that talks to a Host VI and this host VI writes the data to shared variables or reads from them.

 

cRio -> FPGA VI -> Host VI -> SharedVariables -> Client VI 

 

The client should be able to get measured data and also control (write to this shared vars) the host VI.

 

Now the idea is to have Softwareagents, written in Java, on different machines that substitue this client vi and I wanted to access the shared variables directly with Java. 

 

Since there is this Dashboard app for Android there has to be a proper way but I couldn't find any proper documentation on this.

 

Can anyone give me some advice on how to implement this?

 

The better question is if this is the best solution to achive the described scenario. I chose shared vars because many answers on stackoverflow state not to implement tcp/ip connections by myself because errorhandling could become tricky.

 

 

0 Kudos
Message 1 of 5
(2,885 Views)

There is a C API for access of shared variables. I think it should be possible to use this from JAVA.

 

Norbert

 

EDIT: You can look here for some more elaborate answer. I am not sure if there is a generic C/C++ API available without going via DataSocket nowadays.

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 2 of 5
(2,880 Views)
Well I would like to use shared vars because they can encapsulate the netwotking. The way i understood this c API i would have to run labview in every PC that wants to access these sharedvars and call c functionsfunctions from there. Am I right here ?
0 Kudos
Message 3 of 5
(2,874 Views)

I haven't reviewed the example, but this could help to answer your question.

 

Norbert

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 4 of 5
(2,866 Views)

Well thank you I'll have to dig deeper into that code, that will not become a quick fix. I was able to find this whitepaper however it doesn't describe the protocoll it uses. How can that be non documented? Would you stick with the solution I came up with? or is there a better way?

 

Btw, why can't I edit my first post?

0 Kudos
Message 5 of 5
(2,834 Views)