FB_LicFileCopyToDongle

FB_LicFileCopyToDongle 1:

The function block copies a file from the hard disk to the license dongle. If the file is larger than the buffer (cbCopyLen), the file copying procedure is automatically split into several read and write operations until the whole file is copied. Only then does bBusy switch to FALSE.

VAR_INPUT

VAR_INPUT
    sNetIdSrc         : T_AmsNetId;
    sNetIdDest        : T_AmsNetId;
    nPortDest         : UINT;
    sFilePathNameSrc  : T_MaxString;
    sFileNameDest     : STRING;
    pCopyBuff         : PVOID;
    cbCopyLen         : UDINT;
    bExecute          : BOOL;
    dwPassCode        : DWORD;
    tTimeout          : TIME := DEFAULT_ADS_TIMEOUT;
END_VAR

sNetIdSrc: AmsNetId (AMS network identifier) of the TwinCAT computer. If it is to be run on the local computer, an empty string can be entered. (type: T_AmsNetId)

sNetIdDest: AmsNetId (AMS network identifier) of the license dongle (type: T_AmsNetId)

nPortDest: AMS port of the license dongle

sFilePathNameScr: Path name of the file on the hard disk (type: T_MaxString)

sFileNameDest: Name of the file on the license dongle

pCopyBuff: Buffer address for write

cbCopyLen: Count of bytes for write

bExecute: The function block is activated by a positive edge at this input.

dwPassCode: Passcode for file access

tTimeout: Timeout time that must not be exceeded when the command is executed.

VAR_OUTPUT

VAR_OUTPUT
    bBusy    : BOOL;
    bError   : BOOL;
    nErrorId : UDINT;
END_VAR

bBusy: TRUE, as long as the function block is active.

bError: TRUE if an error occurs during command execution.

nErrorId: Supplies the ADS error number when the bError output is set.

Requirements

Development environment

Target platform

PLC libraries to include

TwinCAT v3.1.4022

PC or CX (x64, x86)

Tc2_Utilties >= 3.3.26.0