G Web Development Software

cancel
Showing results for 
Search instead for 
Did you mean: 

Web Services Help - New to LabVIEW

Solved!
Go to solution

Greetings LabVIEW Enthusiasts!

 

I am new to LabVIEW and was hoping some of the more experienced sages may weigh in on what options I may have available!


I have a project that I'm working on which involves streaming data to a web client. My original plan was to follow LabVIEW tutorials for hosting web services through LabVIEW - the only problem is that I'm hosting on Linux. Unfortunately, it appears that LabVIEW Web Services requires Microsoft Silverlight (which appears to be EOL) and is no longer ported to Linux.

Is LabVIEW Web Services Supported on Linux OS? - NI )
Microsoft Silverlight - Wikipedia )

 

The new plan I have is to implement python modules for handling web communications, passing information to and from LabVIEW through a python web interface.

 

Other ideas are to use Apache for hosting LabVIEW generated files (though I cannot find support for LabVIEW CGIs); or a local relational database being used to communicate information between a python web service and the LabVIEW data acquisition, while providing storage for the data. The local database will be an inevitability as I would like to implement a local database for testing before moving said DB to the cloud. 

 

For easier reference in the hopefully lively discussion to follow,

Plan 1 : Python Web Service | LabVIEW

Plan 2 : LabView | Apache 

Plan 3 : LabVIEW | DB | Python Web Service

 

Other information that may be important:

Using a compactRIO which will be continuously sampling sensors at the low rate of 20 Hz, to be communicated to the web client with as low a latency as possible.

0 Kudos
Message 1 of 6
(2,539 Views)

I'm not sure I've digested everything in your message, but let me try to address a few things...

 

* In case you didn't know, NI has multiple web servers that work with LabVIEW.  I usually refer to them as the "LabVIEW" one and the "NI" one.  I'll let NI chime in on Linux support, but I think the NI web server is based on nginx, and it ought to work on Linux. I haven't tried it, though.

 

* NI has lots of information on their website, and it's not uncommon for some of it to not lead you to the latest info. The web page you found about Silverlight may only be talking about the "LabVIEW" web server, and not the "NI" one.  I'm not positive.  This is another opportunity for NI to weigh in.

 

* Even if neither web server works on Linux, you can (if you are feeling brave) just write the web server part in LabVIEW. See https://stravaro.com/2020/08/oauth2-2020-part-5/ for an example of this.  I need to update that web page to talk about some CORS compatibility issues I found, but the idea is the same.

 

Now, to your three ideas:

1. I think what you're saying is that you'll create a Python web service that calls LabVIEW under the hood to get data from the cRIO. There are multiple ways to do this. I believe that in LabVIEW for Linux you can create a shared library in LabVIEW and call it from Python.  Alternatively, you can make the LabVIEW Process standalone, and talk to it through a network connection (e.g., a simple TCP socket).

2. I think you're asking if LabVIEW can be a plugin for Apache. There's probably a way to do this, but I doubt it's an easy path.

3. This seems a lot like #1, except that you are using a database for communications between Python and LabVIEW. Or am I misunderstanding?  The downside here is the latency in going through a database.

 

Brian Powell
Stravaro, LLC


Learn more about the DSH Pragmatic Software Development Workshops.
0 Kudos
Message 2 of 6
(2,470 Views)

Thank you Powell, I am glad to hear that at least some of these solutions have potential!

 

I'm thinking I'll go with Plan 1 - communicating between the Python web service and LabVIEW.

 

Is the LabVIEW FPGA Module required? I was under the impression that it was only needed to program the FPGA to do hardware-based signal processing but then I read an NI article saying that it is needed for the LInux-RT chip to have access to I/O - without specifying which I/O, be it the NI cards in the chassis, or other I/O such as serial or ethernet ports.

 

0 Kudos
Message 3 of 6
(2,436 Views)
Solution
Accepted by James_McN

I can expand on a few points as well.

 

Firstly though I would say, if you come from a Python background - the NI Web Services are far less mature and far more limited than what you would be used to. Still capable for basic systems but you can't, for example, host them through a CGI interface as you mentioned.

 

Brian is right in saying there are a few different components in play. This article gives all the details: https://knowledge.ni.com/KnowledgeArticleDetails?id=kA03q000001DkdFCAS&l=en-GB. In short the application servers don't require silverlight to deploy LabVIEW built web services but the configuration web interface does.

 

Are you deploying to Linux Desktop/Server or NI LinuxRT? LinuxRT definitely supports the application web server. I've not used the new server yet but I expect it is supported under LinuxRT (it is apache under the hood).

 

I think last I checked the Application Web Server was not supported on Linux desktop. From your link I would guess not.

 

So I think your plans with Python look good. Is the general architecture you are talking about then:

 

Client --> Cloud Web Server <-- cRIO

 

If so I certainly wouldn't look to run LabVIEW on the webserver and just have endpoints for the cRIO to write values and the client to access them in Python. So I think that is a vote for plan 1!

James Mc
========
CLA and cRIO Fanatic
My writings on LabVIEW Development are at devs.wiresmithtech.com
0 Kudos
Message 4 of 6
(2,426 Views)

I was told that after I program the cRIO on a windows machine with LabVIEW and the required modules, I'll be able to move it to where I want and communicate with it from a host without needing LabVIEW.

 

I need to try a simple Hello World TCP server program on the cRIO (Still looking for walkthroughs, if anyone wants to make a suggestion). I'll then connect it directly to the host via USB or ethernet. The host will be running a simple Python client program to test how well this works.

 

Additionally, apparently when connected over USB, the cRIO will appear as a network device on the host machine. Hopefully whatever required cRIO driver for this USB-networking capability is available on Linux. If not, hopefully a direct connection over ethernet will work.

0 Kudos
Message 5 of 6
(2,407 Views)

Good evening James,

 

After going through this thread I realized it is relevant to a current project I am working on.

 

I have developed an application for a cRIO that is going to be deployed remotely in the near future. 

 

The client has asked for a "web interface" and I built one using the G Web Development software.

 

I am not a web developer and have a very limited understanding of the G Web Development deployment and web server etc. 

 

Can I deploy the web VI's that I made in the G Web Development software to the cRIO target? 

 

If so, how? I read something on NI in regards to SystemLink API and the webserver not being compatible? 

 

Any advice, help, pokes, prods, etc. would be greatly appreciated! 

 

-Steven

 

Steven Howell
Controls and Instrumentation Engineer
Jacobs Technologies
NASA Johnson Space Center
0 Kudos
Message 6 of 6
(2,293 Views)