ftpCancel (Function)

Top  Previous  Next

Architecture:

X32 / NX32 / NX32L

Firmware version:

2.10 / 1.00.00


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

 

Note: The abort request is handled by the server so depending on the server, the partial files may still exist.

 

 

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 := idname := namelocal := 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;