From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Labiew 2016 Web Server and web page with Labview NXG 3.0

Solved!
Go to solution

Hi, 

I'm trying to develop an application which I have a web server running on LV 2016 with and access via web browser  on LV NXG 3.0. 

I tried to modificate the exemples availables on github but it didn't work.

 

I'm try do make a simple vi that send a text message from LV 2016 to LV NXG, I attached the pictures of my vi and my webvi.

 

Any ideas of what can be the problem? Because I run the web server and the NGX but I can't get the text message.

 

Thanks in advance

 

LV2016Server.PNGLVNXG.PNGNXG.PNG

0 Kudos
Message 1 of 4
(2,928 Views)

Hi Granado_93,

 

For the TestString.vi did you make sure to enable the Use Headers and Buffered settings in the HTTP Method VI Settings Page? As you are using the Web Services APIs to create a response instead of the terminals you will need to set both of those options for the headers to be returned.

 

The Call LabVIEW Web Service from GitHub describes how to configure the output type settings and is reproduced as follows:

 


You must configure the Output Type correctly in order for a LabVIEW web service to send data to a WebVI.

  1. In the Project Explorer, right-click Web Server and select Properties. Note: The Web Server must be stopped before you can edit its properties.
  2. On the left navigation menu, select HTTP Method VI Settings.
  3. Select a Web Service VI from the table and click the Output Type tab under Web Service VI Properties.
  4. Choose one of the following options.
    a. Option 1 (recommended): Select Stream and enable the Use headers and Buffered checkboxes.
    Note: This option requires the web service VI to flatten return data to JSON and return it through Write Response.vi.
    b. Option 2: Select Terminal and select JSON as the output format.
    Note: This option returns data through VI output terminals and serializes LabVIEW data into JSON automatically.

In this case you would use the recommended Option 1 to include the custom header in the response.


Milan
0 Kudos
Message 2 of 4
(2,909 Views)

Hi MilanR

 

Thanks for your answer!

 

I'm using option 2 and this is what I get now.

 

I got 200 on GET status code, and empty brackets on body and on headers it says that there is no-cache

response.PNGspec.PNG

 

0 Kudos
Message 3 of 4
(2,878 Views)
Solution
Accepted by topic author Granado_93

Hi  MilanR

 

I changed to option 1, but I did not parsed the string to json, but it worked.

 

Thanks for your attention!

 

regards

Message 4 of 4
(2,875 Views)