LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Interfacing web services and RT applications

[First, sorry to the NI guys who helped me with this over the phone.  It's not that I don't trust your input but in the multitude of counselors there is wisdom.]

 

If I want to interface my cRIO real-time control loop with the outside world using web services, how do you implement the interface between the web service and the RT app?  If the RT app is included as part of the web service, will it start running at target boot time or must it be invoked using the web service?

0 Kudos
Message 1 of 3
(2,587 Views)

Hi kc64,

 

I'm a little confused by your statement "If the RT app is included as part of the web service". By "RT app" are you referring to a real-time executable that will be running at the startup of your cRIO? If so, what do you mean by including this as part of the web service?

 

In a typical application you would have a RT executable running at startup, as well as a web service that serves as an interface to VIs. The web service only needs to be deployed to the cRIO once, similar to shared variables. Once it has been deployed, it will be hosted on the cRIO at startup.

 

There are couple of different ways for a web service VI to communicate with the already running real-time exectuable, such as shared variables or simple TCP/IP. The use of these methods will have to be integrated into the real-time executable.

 

I hope this answers a couple of your questions. Feel free to post back if you have further questions.

 

Aaron P

Applications Engineer

http://www.ni.com/support

0 Kudos
Message 2 of 3
(2,569 Views)

Aaron--

 

What I have now is a web service only application--I only have one Build Specification and it is for the RESTful web service.  I placed what typically would be my RT application code in the web service Source Files section without any URL mappings to go with it.  Then I simply call the top level RT executable code from the web service by static reference and have it return without waiting for code execution to complete.  At this point, my "RT app" is running on the cRIO and can communicate with the web service via functional globals.

 

The fact that my "RT app" does not run at boot time is not an issue in this application so I feel like I'm getting by on a special case.  If I needed to run the RT application at boot time with headless operation, I think I would still be having a problem.  I just find it a bit quirky that NI's web services put the developer in the situation that, in order to communicate with an RT executable, they must use shared variables (yuck) or implement a mini virtual network.  Why not put the web service and the RT app into the same application space and be done with it?

 

Thanks,

kc64

0 Kudos
Message 3 of 3
(2,564 Views)