03-17-2008 12:14 PM - edited 03-17-2008 12:21 PM
03-17-2008 12:33 PM
Hey Erik,
Funky question!
Are we assuming that your 'terminal' PC can't have direct network access to, for example, shared Windows folders on the machine where the 'main VI' runs? Then the VIs could access that shared folder as if it was on the local machine.
Is it possible to set up an ftp server on the main VI's machine and have the remote client VIs automatically grab any files available from the ftp server? There are several ftp VIs available in the Internet Toolkit.
Those are 2 ways, but if neither are possible there must be loads of others. Have you thought of e-mailing the files off the main PC?
Cheers,
Mark Lee
03-17-2008 01:25 PM
03-17-2008 03:33 PM
Hey Erik,
Thanks for the clarification. As I understand it, when the web server is turned on in LabVIEW, any file that is saved under the web server root directory, which in the default case is:
C:\Program Files\National Instruments\LabVIEW 8.5\www
Will be 'served' up by the web server upon request on whichever port the web server is working on (by default port 80).
Therefore, if you save your files on the 'main' machine to this directory, you should be able to see them when you browse to your main machine on another PC (using say Internet Explorer). For example, on a local network if the web server is running on 'main' PC with the IP address 192.168.0.1, you should be able to see a directory listing of the folder (above) and download the files within if you browse to:
(although your browser may keep picking up the index.html automatically!)
If you want your remote VI to be able to download and/or view these files, you can use the Datasocket Read VI, pass it the URL to the file you want, tell the Datasocket Read VI to retrieve a string and retrieve the xml file(s) that way.
BEWARE that if you're downloading a text file in this way (and I assume this is the same for .xml) - you may need to add [text] to the end of the URL.
Please see the attached screenshot for how I did this on my PC here (with the web server on the same PC 'localhost' - the same should work across your network if you substitute your main PC's name where I've put localhost:8080). The file I was aiming to download is called rest.html. Once the string is in your 'remote' VI obviously you can save it, display it on the front panel, do anything you want with it!
There is loads more info on which file formats the Datasocket VIs can download (and how) at this board:
http://forums.ni.com/ni/board/message?board.id=180&message.id=33766&query.id=149985#M33766
Hope that gives you something to get going with!
Good Luck!
Mark
03-17-2008 05:37 PM
03-18-2008 04:27 AM
Hey Erik,
Ah I see what you mean ![]()
I think what you're suggesting is pretty difficult - if not impossible. The embedded Front Panel is its own ActiveX object, so doesn't expose anything 'clickable' to the remote browser that would trigger the save dialogue.
There are 2 ideas I have - neither are that easy.
1) Is if you can get your application to open an ActiveX reference to the remote browser (ie the application viewing it on the remote machine) you could potentially use ActiveX methods to trigger a save dialogue that way. This is tricky (you would have to find the remote browser's IP address and ensure the correct port(s) are open), and you may have to cope with viewing in different browsers.
2) You could get LabVIEW to add an HTML tag into the file which servers up the application's front panel (the one which LabVIEW normally generates including the ActiveX for the Front panel) which the user can then click on to download the file. The problem with this is you would then have to refresh the remote browser's page (probably manually) to be able to see that link. Not ideal and, technically, not a link on the VI Front panel!
I would seriously consider getting the app to e-mail out the file or push it up to some web space for you to download it at this point.
Sorry I can't think of a better solution!
Best wishes,
Mark
03-18-2008 06:46 AM
03-18-2008 07:20 AM
Hey Erik,
That sounds like a good plan, I hope I remember where to find this thread if I ever need the same functionality!
Good Luck with it!
Mark