Siemens Industry Online Support
Siemens AG
Entry type: Application example Entry ID: 103550797, Entry date: 01/30/2019

FTP/FTPS communication with S7-1500 and CP 1543-1

  • Entry
  • Associated product(s)
Due to its versatility, FTP has established itself as a standard for data exchange. It is independent of the type of connection and the operating system. It additionally offers protection mechanisms such as assigning access rights and explicitly sharing paths. The data exchange can be protected by communication encryption (FTPS).

An S7-1500 controller is to exchange data with a PC via FTP. The CP 1543-1 is ideally suited for this task as it can perform the function of both an FTP client and an FTP server.

The aim is to implement the following scenarios:

  • The CP 1543-1 acting as an FTP client (active) requests data from an FTP server and stores it in a suitable data structure or sends a suitable data structure to an FTP server, where it is stored as a file.
  • The CP 1543-1 acting as an FTP server provides its file system to an FTP client.
  • You can implement both scenarios using FTP (unencrypted) or FTPS (encrypted).

The CP 1543-1 can be used both as an FTP server and as an FTP client. This apllication example describes the configuration as a server. Using the CP as a client requires that the "FTP_CMD" instruction be used. To facilitate the programming involved, we provide the "LFtp" library. The "LFtp_Communication" function block and the "LFtp_Param" data block enable you to integrate FTP communication into your project quickly and easily.

The CP supports FTP and FTPS. This allows you to transfer the data in an unencrypted or encrypted form.

The figure below shows the pictorial schematic and the hardware combination of this example application.


S7-1500 as FTP server:
The S7-1500 station is the FTP server via CP 1543-1 and can either receive data from an FTP client or send data to an FTP client upon request.

S7-1500 as FTP client:
The S7-1500 station is the FTP client via CP 1543-1 and can execute the following FTP commands:

  • STORE (the client saves a file on the server)
  • RETRIEVE (the client requests a file from the server)
  • DELETE (the client deletes a file from the server)
  • APPEND (the client attaches data to a file on the server)
  • RETRIEVE_PART (the client requests parts of the data of a file from the server)

The solution presented here offers the following advantages:

  • Simple and easy to understand FTP communication with an S7-1500 controller with the aid of the "LFtp" block library.
  • Secure transfer via FTPS (FTP over TLS)  

  Documentation (2,3 MB)
 Registrierung notwendig  Library for TIA Portal V15 (1,7 MB)

Additional Information
FTP communcation with S7-300/400
FTP communication with S7-1200

  Documentation TIA Portal V13 SP1 (1,7 MB) 
 Registrierung notwendig  Project TIA Portal V13 SP1 (10,9 MB) 

Last Changes

  • FtpCommunication block changed to comply with styleguide.
  • "LFtp" library created.
  • FTPS added.
  • Update to TIA Portal V15. 
Security information
In order to protect technical infrastructures, systems, machines and networks against cyber threats, it is necessary to implement – and continuously maintain – a holistic, state-of-the-art IT security concept. Siemens’ products and solutions constitute one element of such a concept. For more information about cyber security, please visit