LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can i update an html web page from Labview?

I intend to publish the "status" of an experiment online through an web page. I mean, if my vi is running i would like to have a phrase or indicator set on at my web page. If my Vi is not running i would like this indicator set off. This page is hosted in a server and I would like to know if its possible to update the html file from labview through an ftp connection.

Thanks in advance...

MSc. Alexandre Michel Maul
Parana Federal Univeristy - Brasil
0 Kudos
Message 1 of 10
(3,877 Views)
You can buy the Internet Toolkit from NI which includes FTP functions or use the System Exec function to run the FTP client program that's part of the Windows OS.
Message 2 of 10
(3,877 Views)
Dennis,

Could you please explain better the possibilities of using system exec function... by this time i´m not able to buy the Internet Toolkit as i wish...

Thanks in advance...

MSc. Alexandre Michel Maul
Paraná Federal University - Brasil
0 Kudos
Message 3 of 10
(3,877 Views)
The system exec function is on the Communication palette. Its for executing system commands. On my Win2K system, the help for FTP is:

"Ftp
Transfers files to and from a computer running an FTP server service (sometimes called a daemon). Ftp can be used interactively. Click ftp commands in the Related Topics list for a description of available ftp subcommands. This command is available only if the TCP/IP protocol has been installed. Ftp is a service, that, once started, creates a sub-environment in which you can use ftp commands, and from which you can return to the Windows 2000 command prompt by typing the quit subcommand. When the ftp sub-environment is running, it is indicated by the ftp command prompt.

ftp [-v] [-n] [-i] [-d] [-g]
[-s:filename] [-a] [-w:windowsize] [computer]

Parameters

-v

Suppresses display of remote server responses.

-n

Suppresses autologin upon initial connection.

-i

Turns off interactive prompting during multiple file transfers.

-d

Enables debugging, displaying all ftp commands passed between the client and server.

-g

Disables file name globbing, which permits the use of wildcard characters (* and ?) in local file and path names. (See the glob command in the online Command Reference.)

-s:filename

Specifies a text file containing ftp commands; the commands automatically run after ftp starts. No spaces are allowed in this parameter. Use this switch instead of redirection (>).

-a

Use any local interface when binding data connection.

-w:windowsize

Overrides the default transfer buffer size of 4096.

computer

Specifies the computer name or IP address of the remote computer to connect to. The computer, if specified, must be the last paramete
r on the line."

I use tftp all of the time to transfer files in a similar manner. Test the transfer from the Windows command line and copy it into a VI. Pass the command line to system exec and wait until it's done.
0 Kudos
Message 4 of 10
(3,877 Views)
Dennis,

Do you have any ideia if windows ME have this option?

Thanks...

Alexandre M Maul
0 Kudos
Message 5 of 10
(3,877 Views)
Never used ME but it's on 98, NT, 2K, and XP so I'd be surprised it it wasn't. Check your Windows help or open a command line window (DOS prompt) and type ftp.
0 Kudos
Message 6 of 10
(3,877 Views)
Dennis,

Thanks a lot for all comments and for your suggestion of using system exec. I found a vi at NI that does the hard work.
My last doubt its about the time. I´m spending someting like 45 to 60 seconds to acess my server and put a 5 Kb file on it.

Do you have any ideia in order to reduce this time???

I´m connected through LAN.

Thanks again...

Alexandre Michel Maul
0 Kudos
Message 7 of 10
(3,877 Views)
I'd just be guessing and especially without seeing the VI. If you're using a DNS instead of an ip address, that can sometimes take a while. Maybe there's a delay in logging in. Maybe there's a lot of network traffic. Can you run the profiler on the VI and see where the time is being spent? Since you're on a LAN, do you have the option of just copying the file using the function from the Advanced File Functions palette?
0 Kudos
Message 8 of 10
(3,877 Views)
I´m connected to my server through LAN but i can´t acess the files through windows explorer. I need to connect it through a ftp, telnet or something similar.

I learned a lot today but, by now I don´t know the next step. I´m trying to update a page that is hosted in my server. I would like to update this file when my Vi is set to run or set to stop. What hapenned was that, has I have a while loop, my vi tried to update the page at every loop, not just once when I press the start button (putting a page that have an online field on it) and other when I press the stop button (returning the page with the offline field).

How can i have a boolean that storage the status of my vi (running or not run
ning)???

If i create a boolean control (manually change the status) where I should put the case loop, considering my while loop???

My vi is attached (rotina) for reference... Sorry about the files missing, i don´t know how to put all them together in a dll...

Thanks for helping...

Alexandre M Maul
0 Kudos
Message 9 of 10
(3,877 Views)
I forgot to attach the files...
0 Kudos
Message 10 of 10
(3,877 Views)