AMX FTPSENDER User Manual

i!-FTPSender
instruction manual
integration!Solutions
Software Limited Agreement
LIMITED WARRANTY
LIMITED WARRANTY. AMX Corporation warrants that the SOFTWARE will perform substantially in accordance with the accompanying written materials for a period of ninety (90) days from the date of receipt. Any implied warranties on the SOFTWARE and hardware are limited to ninety (90) days and one (1) year, respectively. Some states/countries do not allow limitations on duration of an implied warranty, so the above limitation may not apply to you.
CUSTOMER REMEDIES. AMX Corporation’s entire liability and your exclusive remedy shall be, at AMX Corporation's option, either (a) return of the price paid, or (b) repair or replacement of the SOFTWARE that does not meet AMX Cor­poration's Limited Warranty and which is returned to AMX Corporation. This Limited Warranty is void if failure of the SOFTWARE or hardware has resulted from accident, abuse, or misapplication. Any replacement SOFTWARE will be warranted for the remainder of the original warranty period or thirty (30) days, whichever is longer.
NO OTHER WARRANTIES. not limited to implied warranties of merchantability and fitness for a particular purpose, with regard to the SOFTWARE, the accompanying written materials, and any accompanying hardware. This limited warranty gives you specific legal rights. You may have others which vary from state/country to state/country.
NO LIABILITY FOR CONSEQUENTIAL DAMAGES whatsoever (including, without limitation, damages for loss of business profits, business interruption, loss of business information, or any other pecuniary loss) arising out of the use of or inability to use this AMX Corporation product, even if AMX Corporation has been advised of the possibility of such damages. Because some states/countries do not allow the exclusion or limitation of liability for consequential or incidental damages, the above limitation may not apply to you.
U.S. GOVERNMENT RESTRICTED RIGHTS
The SOFTWARE and documentation are provided with RESTRICTED RIGHTS. Use, duplication, or disclosure by the Government is subject to restrictions as set forth in subparagraph (c)(1)(ii) of The Rights in Technical Data and Com­puter Software clause at DFARS 252.227-7013 or subparagraphs (c)(1) and (2) of the Commercial Computer Soft­ware--Restricted Rights at 48 CFR 52.227-19, as applicable. Manufacturer is AMX Corporation, 3000 Research Drive, Richardson, TX 75082.
If you acquired this product in the United States, this Agreement is governed by the laws of the State of Texas. Should you have any questions concerning this Agreement, or if you desire to contact AMX for any reason, please
write: AMX Corporation, 3000 Research Drive, Richardson, TX 75082.
AMX Corporation disclaims all other warranties, either expressed or implied, including, but
. In no event shall AMX Corporation be liable for any damages
Table of Contents
Table of Contents
Introduction ...............................................................................................................1
Supported Operating Systems .......................................................................................... 1
Minimum PC Requirements .............................................................................................. 1
Installing i!-FTPSender...................................................................................................... 1
Running i!-FTPSender ..............................................................................................3
Programming..................................................................................................................... 3
Channels .................................................................................................................................. 3
Strings ...................................................................................................................................... 3
Send_Commands .................................................................................................................... 3
Example Code.......................................................................................................................... 4
Troubleshooting i!-FTPSender .......................................................................................... 6
Learning More ................................................................................................................... 6
i!-FTPSender
i
Table of Contents
ii
i!-FTPSender

Introduction

The i!-FTPSender™ allows you to copy a file from one FTP server to another from NetLinx™ code.
This is useful to copy files to the NetLinx Master from another FTP server or to copy files from the
NetLinx Master's disc on chip to another FTP server. This module will work between any two FTP
servers; it is not limited to copying files to and from a NetLinx Master.

Supported Operating Systems

Windows 95
Windows NT 4.0
64 MB of installed memory)
Windows 2000
(minimum requirement); 300 MHz or faster recommended, with 96 MB of installed
memory.)
Windows ME
300 MHz or faster recommended, with 96 MB of installed memory.)
®
/98® (with at least 48 MB of installed memory)
®
Workstation or Server (service pack 6 B or greater, with at least
®
Professional or Server (running on a Pentium 233 MHz processor
®
(running on a Pentium 233 MHz processor (minimum requirement);
Introduction

Minimum PC Requirements

Windows-compatible mouse (or other pointing device)
At least 5 MB of free disk space (150 MB recommended)
VGA monitor, with a minimum screen resolution of 800 x 600
A Network adapter

Installing i!-FTPSender

1. In Explorer, double-click i!-FTPSenderSetup.exe from the directory window where you
downloaded the i!-Email install program.
2. After reading the License Agreement, select I Agree and Next to proceed.
3. The Welcome To i!-FTPSender Setup dialog appears, reminding you to close all Windows
programs before going any further. Click Next to proceed.
4. In the Select i!-FTPSender Install Location dialog, use the Browse button to navigate to a
directory other than the default install directory, if desired. Click Next.
5. In the i!-FTPSender Shortcut Creation dialog, select Install Shortcut Icons for the installed
components on your desktop, if desired.
6. Click Next in the Start i!-FTPSender Installation dialog to install the selected components.
7. The program prompts you to restart your system to complete the installation.
i!-FTPSender
1
Introduction
2
i!-FTPSender

Running i!-FTPSender

Programming

i!-FTPSender is a NetLinx module you can add to any program. You interact with the module
through a virtual device supporting:
Channels
Strings
Send_Commands

Channels

The following table lists the channels supported by i!-FTPSender.
i!-FTPSender Channels
Channel Description
250 Channel turns on when the module is communicating with the source server.
251 Channel turns on when the module is communicating with the destination server.
255 When channel is on, debugging messages from the module are printed to terminal.
Running i!-FTPSender

Strings

The following table lists the strings supported by i!-FTPSender.
i!-FTPSender Strings
S:<code> <message>
D:<code> <message>
Source server message. Code is the FTP return code and message is a mes­sage associated with code.
Destination server message. Code is the FTP return code and message is a message associated with code.

Send_Commands

The following table lists the Send-Commands supported by i!-FTPSender.
i!-FTPSender Commands
COPY-SourceFile[;DestFile]
Copies SourceFile from source server to destination server.
VERSION
Prints the module version to the terminal or telnet window.
Syntax:
’COPY-SourceFile[;DestFile]’
Destination file can be specified as DestFile or will default to SourceFile. Both file names can include a directory path from the root of the FTP server.
Example:
SEND_COMMAND <DEV>,"’COPY-;cSFileName’"
Copies cSFileName from source server to destination server.
Syntax:
’VERSION’
Example:
SEND_COMMAND <DEV>,’VERSION’
Prints the module version to the terminal or Telnet window.
i!-FTPSender
3
Running i!-FTPSender

Example Code

(***********************************************************) (* DEVICE NUMBER DEFINITIONS GO BELOW *) (***********************************************************) DEFINE_DEVICE
dvFTPSServer = 0:8:0 // master port for source ftp socket dvFTPDServer = 0:9:0 // master port for destination ftp socket
TP = 128:1:0 vdvFTPDiag = 33001:1:0 // virtual device for receipt of ftp messages
(***********************************************************) (* CONSTANT DEFINITIONS GO BELOW *) (***********************************************************) DEFINE_CONSTANT
FTPSServerBusy = 250 // flag if source socket is open FTPDServerBusy = 251 // flag if destination socket is open
(***********************************************************) (* DATA TYPE DEFINITIONS GO BELOW *) (***********************************************************) DEFINE_TYPE
(***********************************************************) (* VARIABLE DEFINITIONS GO BELOW *) (***********************************************************) DEFINE_VARIABLE
CHAR cSourceIP[200] CHAR cSourceUser[140] CHAR cSourcePass[140] CHAR cDestIP[200] CHAR cDestUser[140] CHAR cDestPass[140] CHAR cSFileName[100] CHAR cDFileName[100] CHAR cButtonPressed
DEVCHAN dcFTPCopy[] = { {TP,1}, {TP,2}, {TP,3}, {TP,4} }
(***********************************************************) (* MODULES GO BELOW *) (***********************************************************) DEFINE_MODULE 'i!-FTPSenderMod' mdlFTP(vdvFTPDiag, dvFTPSServer, dvFTPDServer, cSourceIP, cSourceUser, cSourcePass, cDestIP, cDestUser, cDestPass)
(***********************************************************) (* THE EVENTS GO BELOW *) (***********************************************************) DEFINE_EVENT
Continued
4
(* FTP Copy Button *) BUTTON_EVENT [dcFTPCopy] { PUSH:
i!-FTPSender
Running i!-FTPSender
{ (* Source Server *) cSourceIP = '192.168.13.33' // define source IP cSourceUser = 'NetLinx' // username for above cSourcePass = 'password' // password for above
(* Destination Server *) cDestIP = '192.168.13.151' // define destination IP cDestUser = 'NetLinx' // username for above cDestPass = 'password' // password for above
SWITCH (GET_LAST(dcFTPCopy)) { CASE 1: { (* File *) cSFileName = 'ftptest.txt' // filename to copy
(* This will cause the file to be copied! *) SEND_COMMAND vdvFTPDiag,"'COPY-',cSFileName" cButtonPressed = 1 } CASE 2: { (* File *) cSFileName = 'ftptest.txt' // filename to copy cDFileName = 'dir1\ftptest.txt' // filename to copy
(* This will cause the file to be copied! *) SEND_COMMAND vdvFTPDiag,"'COPY-',cSFileName,';',cDFileName" cButtonPressed = 2 } CASE 3: { (* File *) cSFileName = 'dir1\ftptest1.txt' // filename to copy cDFileName = 'ftptest1.txt' // filename to copy
(* This will cause the file to be copied! *) SEND_COMMAND vdvFTPDiag,"'COPY-',cSFileName,';',cDFileName" cButtonPressed = 3 } CASE 4: { (* File *) cSFileName = 'dir1\ftptest1.txt' // filename to copy cDFileName = 'dir2\ftptest.txt' // filename to copy
(* This will cause the file to be copied! *) SEND_COMMAND vdvFTPDiag,"'COPY-',cSFileName,';',cDFileName" cButtonPressed = 4 } } } }
i!-FTPSender
(* FTP Activity *) DATA_EVENT[vdvFTPDiag] { STRING: SEND_STRING 0,"'From FTPModule: ',DATA.TEXT" }
(***********************************************************) (* THE ACTUAL PROGRAM GOES BELOW *)
Continued
5
Running i!-FTPSender

Troubleshooting i!-FTPSender

All interaction with the FTP servers is provided as a string from the virtual device. Most problems
can be resolved by reading the server interaction provided by the strings.
Common problems might be:
(***********************************************************) DEFINE_PROGRAM
(* Feedback *) [dcFTPCopy[1]]=(([vdvFTPDiag,FTPSServerBusy] || [vdvFTPDiag,FTPDServerBusy]) && (cButtonPressed = 1)) [dcFTPCopy[2]]=(([vdvFTPDiag,FTPSServerBusy] || [vdvFTPDiag,FTPDServerBusy]) && (cButtonPressed = 2)) [dcFTPCopy[3]]=(([vdvFTPDiag,FTPSServerBusy] || [vdvFTPDiag,FTPDServerBusy]) && (cButtonPressed = 3)) [dcFTPCopy[4]]=(([vdvFTPDiag,FTPSServerBusy] || [vdvFTPDiag,FTPDServerBusy]) && (cButtonPressed = 4))
(***********************************************************) (* END OF PROGRAM *) (* DO NOT PUT ANY CODE BELOW THIS COMMENT *) (***********************************************************)
The IP address or host name supplied for the FTP server does not have an FTP server
running.
The username and/or password may be incorrect.
The source file does not exist.
The destination directory does not exist.
The destination user does not have write access to save the new file.
All of these problems can be solved by watching the strings provided from the i!-FTPSender
module and acting on that information.
This code may not work to FTP files between all FTP servers. Some servers, by default, disable
server to server transfers (also called passive mode) which is used by i!-FTPSender for transferring
files. For instance, Microsoft's IIS disables server to server transfers by default. For more
information, see the Microsoft Support Article at:
http://support.microsoft.com/support/kb/articles/Q247/1/32.ASP.

Learning More

To learn more about FTP file transfers, go to www.protocols.com for general information about
FTP or www.faqs.org/rfcs/rfc959.html (RFC959) for more detailed FTP specifications. For
reference, i!-FTPSender operates under the server-server model described in section 2.3 and the
command sequence outlined in Figure 3 of section 5.2 of Postel & Reynolds' RFC 959.
6
i!-FTPSender
Running i!-FTPSender
i!-FTPSender
7
AMX reserves the right to alter specifications without notice at any time.
2005 AMX Corporation. All rights reserved. AMX, the AMX logo, the building icon, the home icon, and the light bulb icon are all trademarks of AMX Corporation.
©
brussels • dallas • los angeles • mexico city • philadelphia • shanghai • singapore • tampa • toronto* • york
3000 research drive, richardson, TX 75082 USA • 469.624.8000 • 800.222.0193 • fax 469.624.7153 • technical support 800.932.6993
033-004-2551 1/05
AMX reserves the right to alter specifications without notice at any time. *In Canada doing business as Panja Inc.
Loading...