LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Newbie Question: Can a LabView script or exe run on a webserver and interact with PHP?

Solved!
Go to solution

Hi all,

 

I am a complete newbie. I have been given an existing LabView project and have been ask if this can run as part of a PHP website. I would like to be able to create a form (for input) on a webpage, and pass this input the the existing LabView project. The existing LabView project then processes the input and generates a text file that the user would like to download from the site.

 

So my question is, is this possible? If so, how would I set this up and what products/costs might be involved?

 

Thanks in advance

 

A

0 Kudos
Message 1 of 6
(4,102 Views)

You can publish a VI to a webpage under
Tools >> Web Publishing (or something like that, I dont have LabVIEW in front of me right now).

 

The computer with the VI locally on it will act as the host server.
You can then remotely view/control the VI by going to the specified webpage:
http://<hostname>/<vi_name>

 

You can even enable so that the page is password protected.

Cory K
0 Kudos
Message 2 of 6
(4,101 Views)

Thanks Cory, that's great.

 

Sorry for my ignorance, but can this method integrate with an existing PHP website? The existing site we have already allows a user to log in to it. Once logged in, I'd like the user to interact with the VI via the PHP pages. Also, when publishing for the web, what needs to be running on the webserver? Can I publish from my local development machine and then upload some files to the server?

 

Thanks in advance

 

Andy

0 Kudos
Message 3 of 6
(4,097 Views)
Solution
Accepted by topic author andypike

Hi Andy -

 

There are a few limitations to "Remote Panels" which will probably not make what you are trying to do possible.  First of all, the remote panels feature only runs on a LabVIEW Web Server, and this server does not support PHP.  One way to integrate LabVIEW into a web site that utilizes a web server with more features is to put the server on a different port and then use an iFrame or something to embed the LabVIEW Remote Panel page into your own web site.  Communication back and forth will probably have to utilize some other tansportation protocol or read and write files that each other can read and write.

 

I highly recommend you look into another LabVIEW feature called "Web Services."  These are quite a bit different than the Remote Panel approach, and are only available on version 8.6 and onward (and probably only the developers editions).  LabVIEW Web Services allow you to make a LabVIEW program (or modify an existing one) to communicate back and forth using XML.  It is common place to consume and send commands to a LabVIEW Web Service using something like PHP or Flash.  However, you are responsible for providing the interfacing features within the language you are using that consume the LabVIEW Web Service.  So for instance, instead of a graph on the front panel you would need to output graph data and have a PHP program that can do something with it.

 

Web Services are pretty handy if you require a "thin" client, along with the hardware interaction features of LabVIEW.

0 Kudos
Message 4 of 6
(4,093 Views)

Hi Nickerbocker,

 

Now webservices sound possible (I'm actually a .NET developer so know about them). So to clarify, I can have the labview webserver running on a server and my existing website makes calls to the LabView webserver webservices to send and receive data. What products do I need to purchase to make this work? Also, can the LabView web server run on the same server as the existing website (it's a LAMP stack)? It's currently on shared hosting and we only have FTP access to it. If not, we can migrate it to another dedicated box if required. 

 

Thanks again

 

Andy

0 Kudos
Message 5 of 6
(4,087 Views)

I'm not exactly sure what minimum you need.  I have the NI Developers Suite which comes with a lot of things you probably don't need.  My licensure allows me to compile programs and distribute them, this includes distributing web services as standalone .exe.  You will need to contact a NI sells rep to nail down what it is you need. For instance, if you only need licensure for 1 computer running LabVIEW for you to develop on and host the web service, it would probably be cheeper than my license which allows me to distribute my programs to many target computers.  Alternativly, you could hire someone who has a Developers license and they could write your web service to your specifications and then you just install it and run it.  You won't be able to make changes without going through this 3rd party, and it would probably be more expensive than figureing it out on your own...depends on how expensive your time is.

 

I'm not sure if the Web Services feature is available for the Linux flavor of LabVIEW, yet.  They maybe.  But the Windows version only allows compiling applications for a Windows environment.  So I can't say for sure if you can get Web Services running on a LAMP.

 

A LabVIEW web service can coexist in a Windows environment on a server running another web server (like WAMP) so long as they are on different ports.

0 Kudos
Message 6 of 6
(4,075 Views)