Sie sind auf Seite 1von 9

TECHNICAL NOTE

TNOI27

Title: FTP Synchronization Product(s): G3, DSP and Enhanced Modular Controller
ABSTRACT
The purpose of this document is to describe the G3s FTP feature and the configuration steps necessary to use it. It is NOT intended that this document provide a detailed description of FTP communication, but only a brief introduction, necessary to define the terms that are used throughout the remainder of this document.

INTRODUCTION
FTP stands for File Transfer Protocol. Its used on TCP/IP networks to exchange files between devices. An exchange is always made in a client/server fashion, i.e. a client connects to a server to access information by uploading (transfer to the server) or downloading (transfer from the server) data. The G3 FTP support is client and therefore has to connect to a server for the functionality to work. There are numerous FTP servers available on the market, some are free, and others are more professional but licensed. The example in this document will use the FTP server provided with Windows XP professional and Internet Information Services (IIS).

The following steps will be presented: G3 FTP Setup Automatic Log Synchronization Functions for advanced FTP exchange Windows IIS configuration to accept G3 FTP connection

NOTE: The FTP setup shown in this document is also valid for the Data Station and Modular Controller enhanced master products.

G3 FTP SETUP
Red Lion Controls G3 HMIs are programmed using Crimson 2.0 software. This software is free and available on the Internet at www.redlion.net To setup the G3 FTP synchronization, enter the Communications module. Fig. 1.

Fig. 1 Activating the Ethernet port The configuration of the Ethernet port is done in the Communication Module. Click on the word Ethernet. This will display the Ethernet settings for the G3. Change Port Mode: to Manual Configuration, this also activates the Ethernet port. Then, change the IP address of the HMI to an appropriate IP address. Fig. 2. (In this example 192.168.200.10).

Fig. 2

Setting up the Sync Manager Click on the Sync Manager to access the settings on the right pane. Enable the Sync Manger activates the FTP support. You are then able to enter the different settings necessary to access the FTP server. Fig. 3.

Fig. 3 The Server IP address indicates the IP address of the FTP server. In most of the applications, this address will be a computer IP address. The Port Number represents the TCP port the G3 FTP client will connect to. This port number is setup in the FTP server. The default value will most likely suit your application. The Logon Username and Logon Password are credentials required by the server for a client to connect. It has to match a user setup in the Server. Both are case sensitive. For anonymous login, enter anonymous in Username and leave the password blank. The Data Connection provides a choice between standard and PASV mode. You can enable the PASV mode to have the FTP client initiate all data connections rather than waiting for incoming connections from the server. This mode is sometimes required when working behind non-FTP aware firewalls or when using certain forms of network address translation. It is also used when working over a GPRS modem connection. The Keep Alive time is the period for which the FTP connection should be kept alive in case further transfers are required. A value of zero will close the connection as soon as the current transfer has been completed. Non-zero values make for more efficient operation when transferring multiple files. Enable the Record Log File to keep a log of all FTP interactions in the root directory of the CompactFlash card. This file can be useful when debugging FTP operations, but it will tend to degrade performance slightly

AUTOMATIC LOG SYNCHRONIZATION


The automatic log synchronization feature will enable the G3 to synchronize all log files present on the CompactFlash card with the FTP server on a time base. The user does not have to download the log files via the web server anymore, but can access them directly under on the server or computer the G3 synchronized with. To enable Automatic log synchronization, check Enable Log File Sync. Fig.4.

Fig. 4 The Log synchronization becomes available and the following settings can be entered. The Base Directory defines the directory on the server where the log files will be synchronized in. This directory is relative to the folder settings given in the FTP server. For example, if the FTP server is programmed to save any FTP connection under C:\inetpub\ftproot and the Base Directory in Crimson 2.0 is \MyFolder, then all the log files will be saved under C:\inetpub\ftproot\MyFolder. The G3 will duplicate the folder tree present on the CompactFlash card in the Base Directory so data are in the same order. The Sync Period is the frequency at which the terminal will synchronize file transfers. The Sync Delay is the offset in minutes past the hour between file transfers. Use this property to allow multiple terminals file transfers to be offset to avoid collisions.

FUNCTIONS FOR ADVANCED FTP EXCHANGE

Sending a file manually to the server This function will transfer the defined file from the G3 CompactFlash Card to the FTP server.
FTPPUTFILE(CONNECTION, LOCAL, REMOTE, DELETE) ARGUMENT connection local remote delete TYPE int cstring cstring int
DESCRIPTION

FTP connection number, always 0 Local file name on the CompactFlash Card Remote file name on the FTP Server If true, the source file will be deleted after the transfer, otherwise it remains on the source disk

This function returns true if the transfer is successful, false otherwise. In the example below, the file Report.txt will be transferred to the FTP server and deleted from the CompactFlash Card upon success of the transfer. Example: Success = FtpPutFile(0, /LOGS/Report.txt, /Reports/Report.txt, 1); File remote path is relative to server FTP root folder path.

Getting a file manually from the server This function will transfer the defined file from the FTP server drive to the CompactFlash Card of the G3.
FTPGETFILE(CONNECTION, LOCAL, REMOTE, DELETE) ARGUMENT connection local remote delete TYPE int cstring cstring int
DESCRIPTION

FTP connection number, always 0 Local file name on the CompactFlash Card Remote file name on the FTP Server If true, the source file will be deleted after the transfer, otherwise it remains on the source disk

This function returns true if the transfer is successful, false otherwise. In the example below, the file Recipes.csv will be transferred from the FTP server to the CompactFlash Card. The original file will not be deleted from the PC. Example: Success = FtpGetFile(0, /Recipes.csv, /Recipes/Rec001.csv, 0); File remote path is relative to server FTP root folder path.

WINDOWS IIS CONFIGURATION


Windows XP professional comes with Internet Information Services (IIS). This service includes feature a web server and an FTP server. If this service is not installed on your computer, you can install it following the next steps. Installing IIS Go to the Control Panel > Add or remove programs and click Add remove Windows Components. Fig. 5.

Fig. 5 Check Internet Information Services (IIS) and click Details. In this window, check File Transfer Protocol (FTP) Service. Fig. 6. Then click ok and follow the installation instructions.

Fig. 6

FTP Server Configuration The FTP server factory settings do not allow any write access from FTP clients. This parameter has to be changed in the FTP settings that are accessible under Control Panel > Administrative Tools > Internet Information Services. Right click on Default FTP Site and choose properties. Fig. 7.

Fig. 7 The FTP tab shows general setting such as the TCP port and session limits for the server. Fig. 8. Other settings should not be changed.

Fig. 8

The Security Accounts tab provides the user identification given to the FTP server upon anonymous login. Fig. 9.

Fig. 9 The Home Directory tab lets you change the root directory where files will be saved. Here, you need to check Write so the G3 is allowed to write in that folder. Fig. 10.

Fig. 10

User Configuration Once the server is configured, you can create a user to match the G3 login settings. To add a user, go to Control Panel > Administrative Tools > Computer Management. Then, create a new user under Local Users and Groups. Fig. 11.

Fig. 11 The PC is now ready to receive connections from the G3. Connect both of them together and power up the G3. The G3 will then synchronize with the FTP server depending of your settings.

Das könnte Ihnen auch gefallen