FB_LicFileCopyToDongle
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.
Inputs
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
Name | Type | Description |
---|---|---|
sNetIdSrc | T_AmsNetId | AmsNetId (AMS network identifier) of the TwinCAT computer. For the local computer an empty string may be specified. |
sNetIdDest | T_AmsNetId | AmsNetId (AMS network ID) of the license dongle
|
nPortDest | UINT | AMS port of the license dongle
|
sFilePathNameScr | T_MaxString | Path name of the file on the hard disk |
sFileNameDest | STRING | Name of the file on the license dongle |
pCopyBuff | PVOID | Buffer address for write |
cbCopyLen | UDINT | Count of bytes for write |
bExecute | BOOL | The function block is enabled by a positive edge at this input. |
dwPassCode | DWORD | Passcode for file access |
tTimeout | TIME | Time-out period that must not be exceeded when the command is executed. |
Outputs
VAR_OUTPUT
bBusy : BOOL;
bError : BOOL;
nErrorId : UDINT;
END_VAR
Name | Type | Description |
---|---|---|
bBusy | BOOL | When the function block is enabled, this output is set and remains set until a feedback is received. |
bError | BOOL | If an error occurs during the transmission of the command, this output is set after the bBusy output is reset. |
nErrorId | UDINT | Returns 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 |