1. Installation and Getting Started
Refer to the Internet Toolkit Readme for information about installing the Internet Toolkit. Refer to the Getting Started with the G Web Server section of the LabVIEW Internet Toolkit User Guide (linked below) for more information about using the G Web Server. This document includes instructions on starting the G Web server and viewing the CGI and Web examples.
2. Common Gateway Interface (CGI) Basics
The Common Gateway Interface (CGI) protocol accepts information from a Web client, processes this information on the server side, and then sends a response back to the client. CGI is most commonly used in conjunction with HTML forms to provide dynamic data to users over the Web. For example, you input information through text boxes, radio buttons, and drop-down lists and then use a Submit button to pass this information to a server via CGI. The server processes this data and returns an updated page. CGI allows you to make LabVIEW VIs interactive over the Web. Thus, if you cannot run a remote front panel because you do not have the LabVIEW Run-Time Engine, you still can interact with VIs over the Web. CGI also allows you to develop applications that allow a large number of users to interact with VIs over the Web.
Although implementation of CGI programs usually requires knowledge of advanced programming languages, such as PERL or Java, the Internet Toolkit allows you to use CGI within the LabVIEW environment. Refer to the CGI examples that are available through the G Web Server for more information about how CGI VIs work. The CGI Call With Multiple Parameters (POST) example illustrates a common use for CGI. Refer to Accessing CGI Examples in the Internet Toolkit (linked below) for more information about locating examples of CGI scripting with the Internet Toolkit.
In LabVIEW 7.0 or later, you can find the CGI VIs and functions on the CGI palette. In LabVIEW 6.1 or earlier, you can find these VIs and functions on the CGI VIs palette.
3. Simple Mail Transfer Protocol (SMTP) Basics
Simple Mail Transfer Protocol (SMTP) VIs allow you to automatically send emails, along with any attached data and files. In LabVIEW 7.1 or later, you can find the SMTP VIs on the SMTP Email palette. In LabVIEW 6.0 or earlier, you can fine these VIs on the Email VIs palette.
In LabVIEW 7.1 or later, the SMTP VIs are included in the LabVIEW Full and Professional Development Systems. The SMTP VIs are not included in the Internet Toolkit 6.0 or later. Refer to the NI Example Finder for examples of common ways to use SMTP VIs. Refer to Sending Email from LabVIEW 7.x (linked below) for more information about using SMTP VIs.
The SMTP VIs rely on a valid mail server to function correctly. In LabVIEW 6.0 or earlier, you can specify a default mail server in the
labview\internet\internet.ini configuration file. This mail server must be the hostname or IP address of an external server machine that can service requests from the machine with the Internet Toolkit. To determine the appropriate mail server for your company or university, contact a network administrator. Typical SMTP servers have names like smtp.yourcompany.com or mail.yourcompany.com.
4. File Transfer Protocol (FTP) Basics
You can use File Transfer Protocol (FTP) VIs to programmatically transfer files or data from a LabVIEW program to a remote machine or vice-versa. In order for these VIs to work, the remote machine must be running an FTP server. FTP servers require a username and password in order to gain access. Many machines grant access to certain directories if you log in as
anonymous and supply an email address as the password.
After you install the FTP VIs, you can find these VIs on the FTP palette in LabVIEW 7.0 or later and on the FTP VIs palette in LabVIEW 6.1 or earlier.
The FTP palette is organized by row. The high-level VIs are divided into a Get row to bring remote files to the local machine and a Put row to send local files to a remote machine. The local source or destination for data can be either a file or a buffer. If you choose a file source, you can specify a local path that indicates where remote data is stored on your local machine when you use VIs from the Get row. You can also use a file source with VIs from the Put row to specify from which file you send your local data. If you choose a buffer source, LabVIEw stores your data as a LabVIEW string datatype. Refer to the NI Example Finder for examples of using FTP VIs and the Internet Toolkit.
In order to use FTP VIs, you must have an FTP server. Most operating systems do not have a server enabled by default, but there are FTP servers available for all operating systems. Note: National Instruments does not provide technical support for these or other third-party servers.
- Windows 2000/XP Pro: Do not include an FTP server, but you can use a number of commercial or freeware servers. GuildFTPd (linked below) is one popular freeware FTP server.
- Windows Server 2003: Includes an FTP server that is not enabled by default. Refer to Microsoft's How to Set Up an FTP Server in Windows Server 2003 (linked below) for more information about enabling the FTP server.
- Mac OS X: Includes a basic FTP server that is built into Mac OS X. To enable the FTP server, navigate to Apple Menu»System Preferences»View»Sharing»FTP Access and place a checkmark in the checkbox. The login information should match the information for the user account on the system.
- Linux, Red Hat Enterprise WS3: vsftpd is the preferred FTP server in the Red Hat and Fedora Linux distributions. Refer to the Red Hat Enterprise Linux 3: Reference Guide (linked below) for more information about FTP servers in Linux.
5. TELNET Basics
TELNET is a protocol you can use to connect to and interact with remote machines and embedded devices with text-based terminal commands. The remote machine must be running a TELNET server for the Telnet VIs to work correctly. Most machines connected to a large network, such as the Internet, require a username and password. In most cases anonymous users cannot gain access, although some embedded devices ship with a blank username and password. In LabVIEW 7.0 or later, you can find the Telnet VIs on the Telnet palette. In LabVIEW 6.1 or earlier, you can find these VIs on the Telnet VIs palette.
TELNET sessions commonly are carried on interactively with a terminal-style window and text commands. The Internet Toolkit Telnet VIs enable programmatic telnet sessions, in which commands in the form of strings are sent to a remote machine after a connection has been established.
The Internet Toolkit ships with an example Telnet Client VI that enables a user to establish a remote connection and interactively enter commands interactively to the remote host. You can find the Telnet Client VI and other Internet Toolkit Examples in the NI Example Finder.
All Unix and Linux-based systems, including Mac OS X, have built-in TELNET servers. Windows Server also has a TELNET server available. These servers are documented in the respective system's documentation. However, since TELNET is not a secure protocol, TELNET often is disabled on production systems. A more secure version of TELNET, known as Secure Shell (SSH), is popular on these systems. While the LabVIEW Telnet VIs are not directly compatible with SSH, the port-forwarding feature of an SSH client such as PuTTY provides a means to send TELNET commands from LabVIEW to a secure server. Refer to Using SSH TCP Communications Protocol with NI Software (linked below) for more information about using SSH with LabVIEW.
Product Catalog: NI LabVIEW Internet Toolkit
LabVIEW Internet Toolkit User Guide
Developer Zone: Accessing CGI Examples in the Internet Toolkit
KnowledgeBase: Sending Email from LabVIEW 7.x
How To Set Up an FTP Server in Windows Server 2003
Red Hat Enterprise Linux 3: Reference Guide
KnowledgeBase: Using SSH TCP Communications Protocol With NI Software