11-29-2019 06:55 AM
Hello,
I am a beginner for LabVIEW nxg. I am getting data from the server, and pass my server URL to HTML get and want to plot the body into a graph. Moreover, data from the server are in array string so I converted into an array and try to plot it but still not working. So I already did the same application with LabVIEW but the same logic not working in LabVIEW nxg web app. Could you help me, how to do this or do you have any example which helps me to solve this prob ?.
11-29-2019 09:51 AM
Post what you have...
11-29-2019 10:31 AM
thanks for replying. You can see in the figure, this complete code runs on LabVIEW. But in LabVIEW nxg web app it showing error when I am trying to plot graph. I am reading data from the server. And trying to plot here. JSON format in the string so I converted into an array. But here it is showing that this string to array function is not available. Even I can not print the body or header of url.
11-29-2019 10:54 AM
@022004009 wrote:
But here it is showing that this string to array function is not available.
If that is the problem, convert the string manually. In a while loop, get a number (scan from string) until the output of scan from string is empty.
12-02-2019 05:42 AM
Thanks but the problem is that output form body and header are empty and showing nothing. So, first if there is anything then I can convert. So do you know is it the right method to get data from the server using HTML function or I am missing any other function to read data from the server ?.
12-02-2019 06:05 AM
I'm not that familiar with NXG.
The VI sure looks like it should get HTML from a URL.
I'd check if the VI returns an error. If so, it should be helpful.
12-02-2019 06:32 AM
this error I am getting
JavaScript message in Main.html at line 0: XMLHttpRequest cannot load http://127.0.0.1:8001/Web_Server/ParametricCurve. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:52131' is therefore not allowed access.
12-02-2019 08:42 AM
@022004009 wrote:
this error I am getting
JavaScript message in Main.html at line 0: XMLHttpRequest cannot load http://127.0.0.1:8001/Web_Server/ParametricCurve. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:52131' is therefore not allowed access.
The reason is explained here:
why-does-my-javascript-code-get-a-no-access-control-allow-origin-header-is-pr
Next step would be to find a solution... I'm not sure if I can help with that.
12-02-2019 09:13 AM
Thank a lot. I will try this solution.