ftpCancel (Function)

Top  Previous  Next

Architecture:

X32 / NX32 / NX32L

Device support:

All

Firmware version:

2.10 / 1.00.00


This function will notify ftpFileSend or ftpFileReceive functions to abort the current file transfer and return.

 

Note: how the server handles the abort request is individual and partial files may still exists.

 

 

Input:

ID : INT

The ID returned from ftpConnect.

 

Returns: INT

0


- Success.

- 1


- General error.

- 2


- Invalid ID.

- 5


- FTP not open, use ftpOpen to open interface.

 

Declaration:

FUNCTION ftpCancel : INT;
VAR_INPUT
  ID     : INT;
END_VAR;

 


Example:

INCLUDE rtcu.inc
 
VAR
  host : STRING := "ftp.domain.com";
  usr   : STRING := "ftpuser";
  pwd   : STRING := "user pwd";
 
  id   : INT;
END_VAR;
 
THREAD_BLOCK tbSend;
  ftpOpen();
  ...
  id := ftpConnect(host := host, username := usr, password := pwd);
  ftpFileReceive(id := id, name := name, local := local);
  id := 0;
  ftpClose();
END_THREAD_BLOCK;
 
PROGRAM example;
VAR
  send  : tbSend;
END_VAR;
 
  gsmPower(power := ON);
  gprsOpen();
BEGIN
  send();
  ...
  IF id <> 0 THEN
    ftpCancel(id := id);
  END_IF;
  ...
END;
END_PROGRAM;