G Web Development Software

cancel
Showing results for 
Search instead for 
Did you mean: 

Running G Web Example in Christina and Milan's Presentation

I'm trying to run the G Web example from Christina and Milan's presentation and am getting errors with running the G Web application.  I'm using LabView 21.0 and G Web 2022 Q3.  The LabView application runs fine and is simulating temperatures.  This architecture is for local NI Web Server only with no SystemLink Cloud access (the NI Web Server is running).  I see the errors in the attached screen shot when I try running the G Web application (the first action I perform after opening the project is Run).  Why is an API Key being opened if I'm not using SystemLink Cloud?  What step am I missing?  Thank you.

 

 

0 Kudos
Message 1 of 18
(2,335 Views)

Sounds like this refers to the How to Build a Web UI for Your LabVIEW-Based Test System presentation. From the attached screenshot it looks like several dependencies are missing. The screenshot shows the error messages:

 

Missing dependency: NI::Skyline::TagHTTP::Read Tag (DBL).gvi.

Missing dependency: NI::Skyline::TagHTTP::Open Tag.gvi.

Missing dependency: NI::Skyline::TagHTTP::DataType.gtype.

Missing dependency: NI::Skyline::Configuration::Open Configuration API Key.gvi.

Missing dependency: NI::Skyline::TagHTTP::Read Tag (DBL).gvi.

Missing dependency: NI::Skyline::TagHTTP::Open Tag.gvi.

Missing dependency: NI::Skyline::TagHTTP::DataType.gtype.

Missing dependency: NI::Skyline::Configuration::Open Configuration API Key.gvi.

 


This makes me think that during installation of G Web Development Software that some of the Recommended packages were not selected. To follow the presentation example of using the data services with the local NI Web Server you likely need most of the recommended packages:

 

MilanR_0-1666041089037.png

 


Milan
0 Kudos
Message 2 of 18
(2,319 Views)

Why is an API Key being opened if I'm not using SystemLink Cloud?

The example that is currently attached to the presentation post shows the G Web example configured for use with SystemLink Cloud. For use with a local NI Web Server you would need to change the Open Configuration mode from API Key to User in the properties pane for running in the editor. For deployment to the NI Web Server you would remove the Open Configuration altogether to prevent having the password in the built WebVI.

 

The presentation video starting starting at 28:58 discusses those changes needed to the example to run locally:


Milan
0 Kudos
Message 3 of 18
(2,307 Views)

I reinstalled all the recommended G Web packages, and opened the NI Server LabView project, which already has the HTTP Selector configured for localhost.  I opened the W Web project, and per the video, I removed the SystemLink tag portion and added a SystemLink/Open Configuration with the URL set to http://localhost, the user "admin" and the password "test" (I verified the password is test in the NI Web Server configuration).   I also built a package and imported it into the NI Web Server.  It runs the same in both the G Web GUI and a browser; see the attached sample output.  I'm getting "NaN" for the temperature.  I verified the output values are both doubles in the LabView and G Web App.  I also included a screen shot of the LabView and the G Web block diagrams.  Is there an obvious reason for this?  It's almost working.  Thank you for your response.

0 Kudos
Message 4 of 18
(2,255 Views)

Hey johnsmith2022, I don't see anything obviously wrong. Some ideas to help debug the behavior:

 

  • To verify that the LabVIEW application is writing to the tag correctly, you can inspect the value in the Tags Viewer by visiting the server, clicking the navigation menu, and choosing tags, ie if the server is at localhost then http://localhost/#tagviewer
  • WebVIs do not show error dialogs when there are unhandled errors on the wire. If there are unhandled errors you can see them in logs in the editor by going to View >> Output or in the browser by opening the browser developer tools and looking at console logs. Each browser has a way to view console logs and in Chrome you can use ctrl+shift+j to jump directly to the console log.

    Additionally, make sure to wire-up error handling so that you can see log output if there are any messages. The current screenshot (and unfortunately the example as currently posted) does not do expected error handling of stopping the loop for errors and presenting it to the user via indicator / show dialog / etc.
  • When running WebVIs in the G Web editor, make sure the G Web editor is set-up to use the NI Web Server. Can verify using File >> Preferences >> Web Server and verifying the NI Web Server option is selected and the Web Server is configured and running.
  • Verify that the Data Services are started and running by going to the Start menu and running the NI SystemLink Server Configuration application. For a System that installed all the recommended services with G Web it should look similar to the following:
    MilanR_0-1666108357385.png

     


Milan
0 Kudos
Message 5 of 18
(2,241 Views)

Hi MilanR,

 

Thank you for your suggestions.  I see the following in the console log when the G Web App is running in my browser (Edge).  The Policy Evaluator error in the following occurs 92 times before a timeout occurs.  I'll clean up the error wires, as well.  

 

92 polyfills-es2015.c35049b3bc53d163f32e.js:1

Failed to create the Policy Evaluator. "sl.policyevaluator.PolicyEvaluator" could not be found.
log @ polyfills-es2015.c35049b3bc53d163f32e.js:1
DeployedRun.min.js:23704

An unhandled error occurred on the LabVIEW diagram with code 56 at HttpClientGet in NI::HTTP::httpWebServerClient.sli::httpWebServer_Get->NI::HTTP::GET.gvi->NI::Skyline::Utilities::Execute HTTP Verb.gvi->NI::Skyline::TagHTTP::Read Tag Core.gvi->NI::Skyline::TagHTTP::Read Tag (DBL).gvi->WebApp::index.gviweb<APPEND>
The network operation exceeded the user-specified or system time limit.

0 Kudos
Message 6 of 18
(2,233 Views)

Hi johnsmith2022,

 

The log you posted makes it seem like you are running a deployed WebVI (deployed by building the package and uploading it to the web application hosting service). In the deployment scenario you need to double check that you remove credentials / open configuration from the diagram altogether:

 

MilanR_0-1666114284187.png

 

Alternatively, you may want to first test in the editor (which I would not expect the policy evaluator logs) by using the Run command or the Run >> Run in Browser command. The video starting at 17:40 describes how to run in browser and also describes configuring the NI Web Server when using the Run in browser command. When using the Run or Run in Browser commands you need to include credentials with the open configuration VI (note that the url is not actually needed when using Run or Run in browser assuming that G Web is configured correctly with bullet three from above):

 

MilanR_1-1666114440539.png

 

The above assumes you have validated from the previous post that bullet one (the tags are publishing correctly), bullet three (g web is configured to use the NI Web Server), and bullet four (the services are all running).

 

Another thing to consider is that the portion of the video using the local NI Web Server was written assuming the steps were followed with SystemLink Cloud demo first. You may want to make sure to watch the video / go through the demos in full to make sure there was not configuration steps missed or useful information in the first demo with SystemLink Cloud. The local NI Web Server demo only shows the differences needed from the SystemLink Cloud demo to use the local NI Web Server.


Milan
0 Kudos
Message 7 of 18
(2,210 Views)

HI Milan,

 

I opened up the tagviewer and the tag value was empty (this causes the NaN to be displayed on the G Web App).  I manually modified the tag to a valid temperature, and that value appeared in the G Web App display.  So the NI Web Server is running, and the data services for tags seems to be providing the value of the NIConnect.temp tag.  The problem appears to be with the publisher side; the LabView app.  I also went back to running the web app inside the G Web Developer app, and not hosted by the NI Web Server, so I left the authentication in the G Web App.  I changed nothing in the LabView App and am using the NI Web Server version of the code from the zip file unchanged.  I see no way to display a text format of any errors that may be generated from the Write Tag.vi.  Is there another way to see any errors?  Can you think of anything that might prevent the LagView App from writing to the tag hosted locally?  Thank you.  

0 Kudos
Message 8 of 18
(2,182 Views)

I see no way to display a text format of any errors that may be generated from the Write Tag.vi.  Is there another way to see any errors? 



The Write Tag VI should place errors that occur on the error wire that you can check for. As currently written the example does not stop the application or show errors to the user. You should adjust the error handling to inspect any errors that might be occurring:

 

MilanR_0-1666192333249.png

 


Can you think of anything that might prevent the LagView App from writing to the tag hosted locally?

You may also want to verify the address of the server. You can confirm the address of the server in the Start >> NI Web Server Configuration utility on the Summary tab. In my case there is a different server on port 80 so for my machine a different url is used for the NI Web Server:

 

MilanR_1-1666193401047.png

 


Milan
0 Kudos
Message 9 of 18
(2,147 Views)

Hi Milan,

 

Here's the error I'm getting, and it occurs with localhost:80 and localhost:9090:

 

Error -251042 occurred at NI Skyline Utilities.lvlib:Parse HTTP Error.vi:5080001

Possible reason(s):

The web server responded with error 403 Forbidden.


Complete call chain:
NI Skyline Utilities.lvlib:Parse HTTP Error.vi:5080001
NI Skyline Utilities.lvlib:Execute HTTP Verb.vi:7500001
NI Skyline Tag HTTP Library.lvlib:Open Existing Tag.vi:1500001
NI Skyline Tag HTTP Library.lvlib:Open Tag.vi:1540001
NI Skyline Tag HTTP.lvclass:Open Tag HTTP.vi:3570001
Simulate Temperature - Local NI Web Server Publishing.vi

 

My LabView App now looks like this:

 

johnsmith2022_0-1666484212474.png

 

Where would you suggest looking next?  Thank you.

0 Kudos
Message 10 of 18
(2,098 Views)