Applies To: |
|
Summary: |
I’d like to send a file to IDC during runtime. How can I do it? |
Solution: |
It is possible to send a file to an IDC
during runtime, by using FTP cicode functions. These functions are
FTPOpen, FTPFileCopy and FTPClose. FTPOpen is a cicode function
used to establish an FTP connection with an FTP server. Once a
connection is established, FTPFileCopy can be used to copy a file
from the FTP server to a remote path located in IDC. Please note
that an accurate file path is very important when using the
FTPFileCopy function. Once the transfer is successful, the FTP
connection must be closed by using FTPClose. It is important to
close the FTP connection to avoid a resource leak that may degrade
the performance of CitectSCADA. The following code shows how the above functions can be used to transfer a file to an IDC. A file called filetobetransfered.dat located in the Citect server Run directory is going to be transferred. The file will be copied to c:\Citect\data folder located on the IDC. FUNCTION FileTrans() INT iFTPHdl; iFTPHdl = FtpOpen(“”,””,””); // This will establish a connection to citect FTP server // This will transfer a filetobetransfered.dat located in Citect server Run directory TO Citect – data folder located in IDC computer. FtpFileCopy(iFTPHdl,”filetobetransfered.dat”,”\Citect\data\filetobetransfered.dat”); FtpClose(iFTPHdl); //Close FTP connection END
|
Keywords: |
FTP, IDC |
Related Links
Attachments