Applies To:
  • CitectSCADA 5.xx, 6.xx, 7.xx 
  • CitectHMI 5.xx, 6.xx, 7.xx 

CitectSCADA offers FTP functions for downloading files from an FTP server, but they only appear to work on Internet Display Clients (IDCs). Also, there is no function to upload to the FTP server. How can you upload or download from FTP servers using any version of Citect? 

The FTP functions are only designed to work on IDCs. In normal display/manager clients, servers, and web clients, FtpOpen() will always return -1 to indicate failure. One option is to use the WinInet FTP API installed by Internet Explorer. However, this would require DLL calls from CitectSCADA and it could hang CitectSCADA during the FTP upload. Another option is to install a 3rd party ActiveX control on each PC. Both options require components that may not exist on the CitectSCADA PC. An alternative is to use the Windows FTP command to upload the file using a script. This allows the FTP transfer to run in a separate thread. And since the FTP command is built in to Windows there is nothing to install.

The attached Cicode functions use FTP.EXE to upload or download files. Just copy the code into a Cicode file in your project. It also requires the ExecEx Cicode function to be copied from Q4572. Then, call FtpUpload or FtpDownload and pass the FTP server's URL, username, password, and the paths and filename. See the code for more details and examples.