requestFileTransfer()

The function requestFileTransfer() requests a list of files to be transferred from the active to passive partner in a redundant project.

Synopsis

int requestFileTransfer(int manId, dyn_string fileList);

Parameters

Parameter Description
manId

The manager ID of the data manager of the active redundant partner. Use the function convManIdToInt().

for the manId.

fileList

List of files that are transferred. The file name must be relative to the WinCC OA

installation or project directories such as dyn_string fileList = makeDynString("panels/panel1.pnl");.

Return value

The function returns 0 when it has been executed successfully.

Errors

Missing or invalid arguments.

Description

The function requestFileTransfer() requests a list of files from the data manager of the active partner in a redundant project. The files are transferred from the active to passive partner. Start a CTRL script with the function requestFileTransfer() on the passive partner. Start the script with the options: -data [hostname] -event [hostname] via a CTRL manager in the WinCC OA console. Enter the host name of the active computer for -data and -event. The function does not wait until the transfer is finished. To see if the files are still transferred, use the function getPendingFileTransferCount().
main()
{
  int iSysId;
  char iReduNr;
  int iReduManId = convManIdToInt(DB_MAN, 0, iSysId, iReduNr); //Data manager of
the redu partner
  DebugN("Manager ID:", iReduManId);
  dyn_string fileList = makeDynString("panels/panel1.pnl");
  DebugTN("File transferred:",requestFileTransfer(iReduManId, fileList));
  int pendingFilesCount;
  do
  {
    //A file cannot be copied if the redu partner is passive
      pendingFilesCount = getPendingFileTransferCount();
      DebugTN("getPendingFileTransferCount=" + pendingFilesCount);
  }
  while(pendingFilesCount > 0);
}

Assignment

File functions

Availability

CTRL