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 Web Development Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Webservice folder

Dear all,

        I had created an application with webservice where user can generate chart and download it as jpeg file using web browser. At first, user will select the chart option then click Generate button to send out the option to host computer. Host computer will then generate the chart and export as image into the webservice folder in C:\ProgramData\National Instruments\WebServices\aws . Since there are so many webservice folders that might created along the time, and i assume that every time a new webservice folder created, a service_deleted.txt will put into the old webservice folder. So I scan all the folder inside C:\ProgramData\National Instruments\WebServices\aws and then put the chart image into the folder which didt not contain service_deleted.txt so that my client can view/download in web browser. This application is working perfectly but only until its run for a long time where many wedservice folders have been created due to host computer turned OFF and ON. I found that some of the webserivce folder does not contain service_deleted.txt and this caused my application put the chart image into the wrong folder which is not the actual webservice folder.

     A person having the same problem as me and he asked the question in forum (http://forums.ni.com/t5/LabVIEW/Question-about-webservice-using-LabVIEW-2010/m-p/3121476#M896230) . He also stated that how to solve the problem but i tried the method he mentioned but failed.

       May i know any of you experience this problem? Or actually i can have another method so that my client can generate chart and download it from the host computer?

0 Kudos
Message 1 of 10
(7,936 Views)

Hi,  This is not the exact solution what you are looking for. But you can publish your Chart or F.P image into the web check this out it might help "https://decibel.ni.com/content/docs/DOC-41464"  Regards,  Krish

Venugopal
Message 2 of 10
(5,952 Views)

Hi krish,

        I had read that document before i posted discussion here. That method only valid for LV2013 and above but i am still using LV11 . I am wondering that is there any method to identify which webservice folder is the actual running folder

0 Kudos
Message 3 of 10
(5,952 Views)

Hi,  Can You share your vi. So that Ill try and update you Soon.  Regards, Krish.

Venugopal
0 Kudos
Message 4 of 10
(5,952 Views)

Capture.PNG

Sorry i am not sure how to attach vi here so i snapshot the program which i use to put into the webservice folder. I will put into the folder which with service_installed.txt and without service_deleted.txt. In my webservice code, image directory code will be “ /SCADA/images/generated “ . This is working with no errors. But the problem I having now is some of the webservice folders didt contain service_deleted.txt and cause me putting the image into wrong folder. I do not know how to determine which is the folder that actual running the webservice

c1.jpg

0 Kudos
Message 5 of 10
(5,952 Views)

Hi,   Its difficult to solve the problem without the code try to replace the scada with any other name . Cause the aws folder  consists of many scada folders                                             (or)  You can attach your code by clicking the " Show Full Editor" in the top Right corner  in the Reply   Regards, Krish.

Venugopal
0 Kudos
Message 6 of 10
(5,952 Views)

Hi krish,

        The SCADA webservice folders are automatically created by LabView application. Once your application having webservice function, these folders will be created. It will created when the application is started to run and this new created folder will be the actual webservice folder. Prior to the new folder creation, a service_deleted.txt will be inserted into the old webservice folder. So previously i scan each folders which didt contain service_deleted.txt and that folder will be my target folder to put my image. The problem is, some time the service_deleted.txt didt written into the older folder so i get the wrong folder as my target.

          Now i solved the problem where i get the folder creation time instead of scaning service_deleted.txt. The newer creation time folder will be my target folder This forum post helped me on this (http://forums.ni.com/t5/LabVIEW/file-date-created/m-p/109836?requireLogin=False) .By the way, thank you for trying to help me

0 Kudos
Message 7 of 10
(5,952 Views)

Hi Loops,

Glad to see you found a solution by programmatically looking for the most recently modified file in your file folder.

Another option I thought of that might be helpful is to look at the web interface for the application web server running on your computer to see what web services are running. Make sure the NI Application Web Service is running and open this link in an IE or Firefox browser (Google Chrome no longer support the NPAPI used to load the Silverlight based API):

http://localhost:3582/#/WebServicesManagement;component/WebServicesManagementPage.dyn.xaml

Note: I'm not sure if the web interface was included with LabVIEW 2011.

Joey S.
Senior Product Manager, Software
National Instruments
0 Kudos
Message 8 of 10
(5,952 Views)

By the way, just for technical completeness, here's a little bit more information I was able to dig up from R&D about the issue you were running into with the folders:

- LabVIEW 2011 didn't properly clean up old web services that were running. This is something that shouldn't persist in LabVIEW 2012 and newer.

- Only the web service itself can tell what folder it's in. A web method could call Current VI's Path or a much better option would be to use Read Request Variable.vi with the input Service Path which will point to the root web service folder.

- If it's a separate application generating the image, you could upload the image to the web service and let it write it into the correct folder on disk.

- Another workaround for this would be to install a newer run-time engine, which would upgrade the web server so that it would correctly clean up all of the extra folders and reliably drop service_installed.txt. You could still build the web service in LabVIEW 2011, and the VIs would still run in the 2011 RTE, but the web server would be newer. Even LabVIEW 2012 RTE would fix this issue, but I would recommend installing 2014 RTE just to have all latest fixes. The only caveat to this would be when deploying the application via an installer, you would need to package in two RTEs, which isn't fun.

Joey S.
Senior Product Manager, Software
National Instruments
0 Kudos
Message 9 of 10
(5,952 Views)

Hi Joey,

     Because i am passing the user's chart selection into a non-webservice VI through shared variables. Then the non-webservice VI will generate the image and put into the folder. I never thought that i can actually use current VI's path and pass to non-webserivce VI together with chart selection. This is the actual way to get the webservice VI path. Simple and easy. Thank you for an easier solution for this

     I cannot get the folder path in the web interface, maybe is because of version 2011 having different interface with newer version.

      Speak of chrome's NPAPI support, it is actually been disabled by default in the latest chrome version. We can enable it by going to chrome://flags/ . Check this out :http://forums.ni.com/t5/LabVIEW/How-to-accees-the-LabVIEW-Web-Server-using-Chrome/td-p/2542855/page/...

Message 10 of 10
(5,952 Views)