01-24-2019 04:58 AM - edited 01-24-2019 05:06 AM
I have tried understanding and working on one of the built-in examples in LabVIEW NXG which is also discussed in githun as shown in the link below:
https://github.com/ni/webvi-examples/tree/master/CallLabVIEWWebService
The first issue, I faced was to communicate LabVIEW NXG 2.1 and Standard LabVIEW 2018. The issue was due to using two different ports i.e. 8080 for debug port in LabVIEW 2018 and port 8001 in LabVIEW NXG 2.1. It was throwing an error of CORS origin or the client was not able to reach the target server. Finally I solved the issue by using an unsed port say 5007 for both the applications and it worked fine! Also I am able to build and run the web application in any browser in my local PC.
Now I am facing two issues here:
I have followed the 'Setup' steps as mentioned in the example in GitHub.
If I run the Main.gviweb in NXG and then go to WebApp.gcomp and build it. The build fails by giving a error with the message 'dependency is currently running'. Then, I am not able to access the web application in the web.
However, once i run the Main.gviweb and stop it. After halting it's execution and then trying to build it, this time it works.
Can someone tell me why this happens? Why can't I run the gviweb and then build?Why should i first stop ist execution and then build it?
I want to host the web application in a remote system connected with the same network as the local PC (where the LabVIEW webservice is running). I have tried with the follwing url, but I am not able to access it remotely:
http://lPaddress_of_local_PC/WebApp_Web%20Server/Main.html
Can someone tell how I can acccess the link from any remote Sysem?
Does anyone know if it is possible to do parallel execution between LV NXG and Standard LV? Since the example executes in a serial manner i.e. NXG sents the data in JSON format to standard LV and once all the procesing is completed in Standard LV then it sends the output in JSON format back to the NXG progran. What if all These Things can be done parallely?
PS: If anyone has more detailed information or materials about LabVIEW NXG with be of great help!Thank you
01-27-2019 04:38 PM - edited 01-27-2019 04:41 PM
Hi enthusiast4,
Can someone tell how I can acccess the link from any remote Sysem?
If I understand correctly, the following is what you are trying to do:
Machine 1 is a development machine. On Machine 1 you are running the LabVIEW 2018 Web Service. On Machine 1 you also opened the WebVI example in LabVIEW NXG. You went to the System Designer and performed the last step in Setup which says "You can automatically launch and view the Web application locally by going to System Designer>> Web Server >> right-click WebApp.gcomp >> Run". When you did the run command on Machine 1 it opened the WebVI in the browser that was talking to the LabVIEW 2018 Web Service on Machine 1. The browser on Machine 1 opened to a url like the following: "http://localhost:6033/HtmlVI/Build/Web%20Server/Interactive/WebApp.gcomp/Main.html". In this case the port 6033 is a random port that may change when LabVIEW NXG is restarted.
Machine 2 is a remote machine. On Machine 2 you opened a Web Browser to the url: http://lP_address_of_Machine_1:6033/HtmlVI/Build/Web%20Server/Interactive/WebApp.gcomp/Main.html
But Machine 2 was not able to connect to the WebVI hosted in Machine 1.
If the above describes the actions you have taken then this is expected behavior. The System Designer >> Run command hosts your WebVI in a temporary Web Server embedded in the LabVIEW NXG Editor. It is only intended to allow you to preview your WebVI in a browser on Machine 1 and only allows for localhost access.
Instead of relying on the embedded Web Server you should host the WebVI in a Web Server that stays available and can be accessed by other machines on the network. The Hosting a Web Application on a Server help topic describes several options for hosting the WebVI.
Since the example executes in a serial manner i.e. NXG sends the data in JSON format to standard LV and once all the processing is completed in Standard LV then it sends the output in JSON format back to the NXG program. What if all These Things can be done parallely?
Do you have an example of what you want to accomplish?
If you mean can LabVIEW 2018 Web Services respond to multiple requests in parallel then that is possible by making VIs reentrant and using an architecture that does not require heavy processing in the Web Methods
If you mean bi-directional communication between the WebVI and the Web Service instead of polling with HTTP requests, then this is not easily doable with LabVIEW NXG 3.0 WebVIs. One technology that enables bidirectional communication is WebSockets (a technology we would like to support in a future version of WebVIs). Another technology that abstracts over the complexity of handling HTTP requests is the Tags and Messages APIs available with the NI Web Server that is included with the LabVIEW NXG Web Module.
More information about the Tags and Messages APIS can be found in the help topic: http://www.ni.com/documentation/en/systemlink/latest/data/sharing-data-across-systems/
And in the GitHub example: https://github.com/ni/webvi-examples/tree/master/CallSystemLinkDataServices
01-30-2019 05:17 AM - edited 01-30-2019 05:18 AM
Hi MilanR,
I have hosted the webVI on a web Server which is accesible by all the machines. I have followed all the steps as mentioned in the link you said. However, I am still not able to remotely access the web application on Machine 2 connected to the same network as Machine 1 (the host PC). What it does is: It publishes the web application in Machine 1 i.e. i can publish and see the we VI on Machine 2 (remote system) but no interaction i.e. the Webpage doesn't do anything as expected . It just displays the web application on a browser in machine2 but that's it. The controls or indicators in the web page aren't interactive. It throws a error message saying :'Unable to load required dependencies.Please verify all WebVI files are available and served using an http Server or use a browser that can load files drectly from the filesystem'
04-03-2019 06:52 AM
Hello enthusiast4,
I am working with something similar and I faced some issues along the way.
Could you provide a picture or the vi's for a better understanding about the problem?
best regards
09-11-2019 08:29 AM
i face same problem do you reach to any solution
04-29-2020 11:18 AM - edited 04-29-2020 11:19 AM
Hi.
Did Anyone solve this problem? I have the same problem. The page is loaded, but I don´t get data. Also it takes so long to load the page.
05-04-2020 06:00 AM
I´ve just solved the problem. Enabling ports in the router and disabling firewall solved the communication