Feedback on NI Community

cancel
Showing results for 
Search instead for 
Did you mean: 

how to generate a html page for a VI which is created by a vi template dynamically

I have a executable which calls a VI template dynamically, say it is subvi.vit. A subvi1.vi is generated by the template. On my web server, I want to display the front panel of subvi1.vi. How can I generate its html file programmatically if I don't want to use CGI?
 
Thanks for your reply. 
0 Kudos
Message 1 of 12
(7,708 Views)

This is the feedback board. You want the LV board.

You can probably easily edit an existing HTML file created by the wizard (it's just ASCII, so the file VIs will work perfectly) and replace the path to point at your new VI, but I haven't tested this. Have a look at an html file created by the wizard and you can probably find how to do this easily enough.


___________________
Try to take over the world!
0 Kudos
Message 2 of 12
(7,705 Views)
Hi tst,
 
Thanks for your fast response.
 
I don't know how I could make this mistake to put the post under feedback board but let's keep it here because I don't know how to move it to LV board unless I start a new thread.
 
I don't know if I could do it in wizard because subvi1.vi doesn't exist before the executable runing. I have to create a html file during running.
 
I did generate a html file in wizard but I have to use subvi.vit to do the web publishing. When I log into web server http:\\localhost\subvi.html, I got error message "the requested VI is not loaded into the memory on the server computer". The reason is that the vi template subvi.vit was loaded dynamically, so it is not in memory any more once the VI reference is closed. But subvi1.vi is running now. I need to display subvi1.vi's real-time front panel.
 
Did I clarify my issue?
 
I would appreciate your help.
 
regards,
 
0 Kudos
Message 3 of 12
(7,703 Views)

It's probably not your fault it was posted here. The NI forums have some problems there.

I see what you're saying. Here's a suggestion - Have a simple html file (on the server) with a link in it. When you run the vit, have your code open this html file using the file functions and modify the link to reflect the path of the new VI. Give the user the path to the html with the link in it and that should solve your problem - the user will have a regular address and the content of that page will change to reflect where the current VI is. You might even be able to set it to automatically redirect so the user doesn't have to click to link.


___________________
Try to take over the world!
0 Kudos
Message 4 of 12
(7,697 Views)
Hi tst,
 
Thanks for your comment.
 
I'll try it and let your know what I'll get.
 
Thanks.
 
 
0 Kudos
Message 5 of 12
(7,694 Views)

Hi tst,

I am trying to do what you suggested, but I don't know how to relink the new VI's name to the html. Could you please point me where the functions are?

Thanks.

0 Kudos
Message 6 of 12
(7,688 Views)
If you read the html file (using the regular file VIs, even something as simple as Read Characters From File), it looks like the "LVFPPVINAME" part is what's responsible in deciding which VI is opened (the VI has to be in memory, so apparently there is no need for a full path). I'm guessing that if you read the file as a string, replace the name of the old VI with the new VI and save, you should be fine.

___________________
Try to take over the world!
0 Kudos
Message 7 of 12
(7,683 Views)

Hi tst,

I didn't get success on it. I have rewrite the vi's name in HTML file but I still get message on web server which is "the requested vi is not loaded into memory on the server computer".

I wonder if the subvi (e.g. subvi 1.vi) generated by subvi template is in memory.

help!!! 🙂

Thanks.

 

0 Kudos
Message 8 of 12
(7,675 Views)

Hi tst,

I think I get it.

Thanks for all you points.

 
0 Kudos
Message 9 of 12
(7,672 Views)

Hi tst,

I made my sample program work. But my real application didn't. Because my application has a lot subvis which have control templates in them. So when I tried to launch the web server, the web page was trying to download the panel but didn't success and it said "The VI named 'subvi 1.vi' contained unsaved untitiled subvis. Can not save the VI before all its untitled subvis committed to disk. Do you want to save untitiled subvi to disk now?" If I click OK, then it asked me to rename the custom control to a new file (such as * 1.ctl) instead of *.ctt.

Do you have any comments on it?

Thanks.

0 Kudos
Message 10 of 12
(7,657 Views)